All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javax.media.j3d.Sensor

java.lang.Object
   |
   +----javax.media.j3d.Sensor

public class Sensor
extends Object
A Sensor object containing the sensor's hotspot in that Sensor's coordinate system, together with a series of timestamped SensorRead-objects and their associated Button-states.


Variable Index

 o DEFAULT_SENSOR_READ_COUNT
Default SensorRead object count.
 o HAND_PREDICTOR
Assume the sensor is predicting hand position/orientation
 o HEAD_PREDICTOR
Assume the sensor is predicting head position/orientation
 o NO_PREDICTOR
Use no prediction policy
 o PREDICT_NEXT_FRAME_TIME
Generate the value to correspond with the next frame time
 o PREDICT_NONE
Do no prediction

Constructor Index

 o Sensor(InputDevice)
Construct a new sensor, consisting of a set of default number of SensorRead objects, no buttons, and a hot spot at (0.0, 0.0, 0.0) in the sensor's coordinate system.
 o Sensor(InputDevice, int)
Construct a new sensor, consisting of the stated number of readings, no buttons, and a hot spot at (0.0, 0.0, 0.0) in the Sensor's coordinate system.
 o Sensor(InputDevice, int, int)
Construct a new sensor, consisting of the stated number of readings, the stated number of buttons, and a hot spot at (0.0, 0.0, 0.0) in the Sensor's coordinate system.
 o Sensor(InputDevice, int, int, Point3d)
Construct a new sensor, consisting of the specified number of SensorRead objects, the specified number of buttons, and the specified hot spot in the Sensor's coordinate system.
 o Sensor(InputDevice, int, Point3d)
Construct a new sensor, consisting of the specified number of SensorRead objects, no buttons, and the specified hot spot in the Sensor's coordinate system.
 o Sensor(InputDevice, Point3d)
Construct a new sensor, consisting of a set of default number of SensorRead objects, no buttons, and the specified a hot spot in the Sensor's coordinate system.

Method Index

 o getCurrentSensorRead()
Get the current sensor read count.
 o getDevice()
Retrieves the sensor's associated input device
 o getHotspot(Point3d)
Get the sensor's hotspot offset in this sensor's coordinate system.
 o getPredictionPolicy()
This function returns the prediction policy used by this sensor.
 o getPredictor()
This function returns the type of predictor used by this sensor.
 o getRead(Transform3D)
Computes the sensor reading consistent with the prediction policy and copies that value into the specified argument.
 o getRead(Transform3D, long)
Computes the sensor reading consistent as of time deltaT in the future and copies that value into the specified argument.
 o getSensorButtonCount()
This function returns the number of buttons associated with this sensor.
 o getSensorReadCount()
This function returns the number of SensorRead objects associated with this sensor.
 o lastButtons()
Returns the state of the buttons associated with the most recent sensor reading.
 o lastButtons(int)
Returns the state of the buttons associated with the kth most recent sensor reading.
 o lastRead(Transform3D)
Extracts the most recent sensor reading and copies that value into the specified argument.
 o lastRead(Transform3D, int)
Extracts the kth most recent sensor reading and copies that value into the specified argument.
 o lastTime()
Returns the time associated with the most recent sensor reading.
 o lastTime(int)
Returns the time associated with the kth most recent sensor reading.
 o setDevice(InputDevice)
Set the sensor's associated input device
 o setHotspot(Point3d)
Set the sensor's hotspot offset in this sensor's coordinate system.
 o setNextSensorRead(long, Transform3D, int)
Set the next sensor read objects to the specified values
 o setPredictionPolicy(int)
This function sets the prediction policy use by this sensor.
 o setPredictor(int)
This function set the type of predictor to use with this sensor.
 o setSensorReadCount(int)
Set the number of sensor read objects per Sensor.

Variables

 o PREDICT_NONE
 public static final int PREDICT_NONE
Do no prediction

 o PREDICT_NEXT_FRAME_TIME
 public static final int PREDICT_NEXT_FRAME_TIME
Generate the value to correspond with the next frame time

 o NO_PREDICTOR
 public static final int NO_PREDICTOR
Use no prediction policy

 o HEAD_PREDICTOR
 public static final int HEAD_PREDICTOR
Assume the sensor is predicting head position/orientation

 o HAND_PREDICTOR
 public static final int HAND_PREDICTOR
Assume the sensor is predicting hand position/orientation

 o DEFAULT_SENSOR_READ_COUNT
 public static final int DEFAULT_SENSOR_READ_COUNT
Default SensorRead object count. The number of SensorRead objects constructed if no count is specified.

Constructors

 o Sensor
 public Sensor(InputDevice device)
Construct a new sensor, consisting of a set of default number of SensorRead objects, no buttons, and a hot spot at (0.0, 0.0, 0.0) in the sensor's coordinate system.

Parameters:
the - Sensor's associated device.
 o Sensor
 public Sensor(InputDevice device,
               int sensorReadCount)
Construct a new sensor, consisting of the stated number of readings, no buttons, and a hot spot at (0.0, 0.0, 0.0) in the Sensor's coordinate system.

Parameters:
the - Sensor's associated device.
sensorReadCount - the number of SensorReads to associate with this sensor.
 o Sensor
 public Sensor(InputDevice device,
               int sensorReadCount,
               int sensorButtonCount)
Construct a new sensor, consisting of the stated number of readings, the stated number of buttons, and a hot spot at (0.0, 0.0, 0.0) in the Sensor's coordinate system.

Parameters:
the - Sensor's associated device.
sensorReadCount - the number of SensorReads to associate with this sensor.
sensorButtonCount - the number of buttons associated with each sensor read.
 o Sensor
 public Sensor(InputDevice device,
               Point3d hotspot)
Construct a new sensor, consisting of a set of default number of SensorRead objects, no buttons, and the specified a hot spot in the Sensor's coordinate system.

Parameters:
the - Sensor's associated device.
the - Sensor's hotspot.
 o Sensor
 public Sensor(InputDevice device,
               int sensorReadCount,
               Point3d hotspot)
Construct a new sensor, consisting of the specified number of SensorRead objects, no buttons, and the specified hot spot in the Sensor's coordinate system.

Parameters:
the - Sensor's associated device.
sensorReadCount - the number of SensorReads to associate with this sensor.
hotspot - The sensor's hotspot defined in its local coordinate system.
 o Sensor
 public Sensor(InputDevice device,
               int sensorReadCount,
               int sensorButtonCount,
               Point3d hotspot)
Construct a new sensor, consisting of the specified number of SensorRead objects, the specified number of buttons, and the specified hot spot in the Sensor's coordinate system.

Parameters:
the - Sensor's associated device.
sensorReadCount - the number of SensorReads to associate with this sensor.
sensorButtonCount - the number of buttons associated with each sensor read.
hotspot - The sensor's hotspot defined in its local coordinate system.

Methods

 o setPredictor
 public void setPredictor(int predictor)
This function set the type of predictor to use with this sensor.

Parameters:
predictor - predictor type one of PREDICT_NONE or PREDICT_NEXT_FRAME_TIME.
 o getPredictor
 public int getPredictor()
This function returns the type of predictor used by this sensor.

Returns:
returns the predictor type. One of PREDICT_NONE or PREDICT_NEXT_FRAME_TIME.
 o setPredictionPolicy
 public void setPredictionPolicy(int policy)
This function sets the prediction policy use by this sensor.

Parameters:
policy - prediction policy one of NO_PREDICTOR, HEAD_PREDICTOR, or HAND_PREDICTOR.
 o getPredictionPolicy
 public int getPredictionPolicy()
This function returns the prediction policy used by this sensor.

Returns:
returns the prediction policy. one of NO_PREDICTOR, HEAD_PREDICTOR, or HAND_PREDICTOR.
 o setHotspot
 public void setHotspot(Point3d hotspot)
Set the sensor's hotspot offset in this sensor's coordinate system.

Parameters:
hotspot - the sensor's new hotspot
 o getHotspot
 public void getHotspot(Point3d hotspot)
Get the sensor's hotspot offset in this sensor's coordinate system.

Parameters:
hotspot - the variable to receive the sensor's hotspot
 o setDevice
 public void setDevice(InputDevice device)
Set the sensor's associated input device

Parameters:
device - the sensor's new device
 o getDevice
 public InputDevice getDevice()
Retrieves the sensor's associated input device

Returns:
the sensor's device
 o getRead
 public void getRead(Transform3D read)
Computes the sensor reading consistent with the prediction policy and copies that value into the specified argument.

Parameters:
read - The matrix that will receive the predicted sensor reading
 o getRead
 public void getRead(Transform3D read,
                     long deltaT)
Computes the sensor reading consistent as of time deltaT in the future and copies that value into the specified argument.

Parameters:
read - The matrix that will receive the predicted sensor reading
deltaT - The time delta into the future for this read
 o lastRead
 public void lastRead(Transform3D read)
Extracts the most recent sensor reading and copies that value into the specified argument.

Parameters:
read - The matrix that will receive the most recent sensor reading
 o lastRead
 public void lastRead(Transform3D read,
                      int kth)
Extracts the kth most recent sensor reading and copies that value into the specified argument.

Parameters:
read - The matrix that will receive the most recent sensor reading
 o lastTime
 public long lastTime()
Returns the time associated with the most recent sensor reading.

Returns:
the time associated with the most recent sensor reading.
 o lastTime
 public long lastTime(int k)
Returns the time associated with the kth most recent sensor reading.

Returns:
the time associated with the kthmost recent sensor reading.
 o lastButtons
 public int lastButtons()
Returns the state of the buttons associated with the most recent sensor reading.

Returns:
the state of the buttons associated with the most recent sensor reading.
 o lastButtons
 public int lastButtons(int k)
Returns the state of the buttons associated with the kth most recent sensor reading.

Returns:
the state of the buttons associated with the kth most recent sensor reading.
 o getSensorReadCount
 public final int getSensorReadCount()
This function returns the number of SensorRead objects associated with this sensor.

Returns:
the number of SensorReadObjects associated with this sensor.
 o setSensorReadCount
 public void setSensorReadCount(int count)
Set the number of sensor read objects per Sensor. This is a calibration parameter that should be set before initializing Java 3D.

Parameters:
count - the new sensor read count
 o getSensorButtonCount
 public final int getSensorButtonCount()
This function returns the number of buttons associated with this sensor.

Returns:
the number of buttons associated with this sensor.
 o getCurrentSensorRead
 public SensorRead getCurrentSensorRead()
Get the current sensor read count.

Returns:
s the number of sensor read objects per sensor
 o setNextSensorRead
 public void setNextSensorRead(long time,
                               Transform3D transform,
                               int buttons)
Set the next sensor read objects to the specified values

Parameters:
time - The next SensorRead's associated time
transform - The next SensorRead's transformation
buttons - the next SensorRead's button state

All Packages  Class Hierarchy  This Package  Previous  Next  Index