| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Leaf javax.media.j3d.Behavior com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior com.sun.j3d.utils.behaviors.vp.WandViewBehavior
WandViewBehavior | public class WandViewBehavior extends ViewPlatformBehavior (Code) | | Manipulates view platform transforms using a motion-tracked wand or mouse
equipped with a six degree of freedom (6DOF) sensor. An optional two axis
(2D) valuator sensor is also directly supported. Default operation is set
up to enable both direct manipulation of the view transform and translation
back and forth along the direction the 6DOF sensor is pointing; rotation
is handled by the 2D valuator if available. An arbitrary number of sensors
and action bindings can be customized by accessing this behavior's
SensorEventAgent directly.
This behavior can be instantiated from the configuration file read by
ConfiguredUniverse and fully configured using the
ViewPlatformBehaviorProperties command to set the properties
described below, but neither ConfiguredUniverse nor
SimpleUniverse are required by this behavior. Conventional
set and get accessors are provided for
configuring this behavior directly; these methods have the same names as
the properties but are prefixed with get and set .
Property values are spelled with mixed case strings while the corresponding
constant field names for the conventional accessors are spelled with upper
case strings and underscores.
WandViewBehavior.Sensor6D Sensor6D is the 6DOF sensor to use. This can also be set
directly with the appropriate constructor. This sensor must generate 6
degree of freedom position and orientation reads relative to the tracker
base in physical units. By default this behavior provides an echo for the
6DOF sensor which indicates its position and orientation in the virtual
world; the echo attributes can be set by the
WandViewBehavior.EchoType EchoType ,
WandViewBehavior.EchoSize EchoSize ,
WandViewBehavior.EchoColor EchoColor , and
WandViewBehavior.EchoTransparency EchoTransparency properties. See also the
WandViewBehavior.NominalSensorRotation NominalSensorRotation property, and the
setHotSpot method of the Sensor class.
WandViewBehavior.Sensor2D Sensor2D is an optional 2D valuator to use in conjunction
with the 6DOF sensor. This can be set directly with the appropriate
constructor. The valuator should generate X and Y reads ranging from [-1.0
.. +1.0], with a nominal (deadzone) value of 0.0. The default
configuration expects to find these values along the translation components
of the read matrix, at indices 3 and 7, but these indices can be also be
specified by the
WandViewBehavior.MatrixIndices2D MatrixIndices2D property.
WandViewBehavior.ButtonAction6D ButtonAction6D sets an action for a specific button
on a 6DOF sensor. The actions available are:
-
GrabView - Directly manipulates the view platform by moving
it in inverse response to the sensor's position and orientation,
producing the effect of attaching the virtual world to the sensor's
movements. If a button is available then this action is bound to button 0
by default.
-
TranslateForward - Translates the view platform forward along
the direction the sensor is pointing; the virtual world appears to move
towards the sensor. The default is button 1 if two buttons are available.
Related properties are
WandViewBehavior.TranslationSpeed TranslationSpeed ,
WandViewBehavior.AccelerationTime AccelerationTime ,
WandViewBehavior.ConstantSpeedTimeConstantSpeedTime , and
WandViewBehavior.FastSpeedFactor FastSpeedFactor .
-
TranslateBackward - Translates the view platform backwards
along the direction the sensor is pointing; the virtual world appears to
move away from the sensor. The default is button 2 if three buttons are
available.
-
RotateCCW - Rotates the view platform counter-clockwise about
a Y axis; the virtual world appears to rotate clockwise. This action is
not assigned by default. Related properties are
WandViewBehavior.RotationSpeedRotationSpeed ,
WandViewBehavior.RotationCoords RotationCoords ,
WandViewBehavior.TransformCenterSource TransformCenterSource ,
WandViewBehavior.TransformCenterTransformCenter , and AccelerationTime .
-
RotateCW - Rotates the view platform clockwise about a Y axis;
the virtual world appears to rotate counter-clockwise. This action is not
assigned by default.
-
ScaleUp - Scales the view platform larger so that the virtual
world appears to grow smaller. This action is not assigned by default.
Related properties are
WandViewBehavior.ScaleSpeed ScaleSpeed ,
TransformCenterSource , TransformCenter , and
AccelerationTime .
-
ScaleDown - Scales the view platform smaller so that the
virtual world appears to grow larger. This action is not assigned by
default.
WandViewBehavior.ReadAction2D ReadAction2D sets the action bound to 2D valuator
reads; that is, non-zero values generated by the device when no buttons
have been pressed. If the value is (0.0, 0.0) or below the threshold value
set by
WandViewBehavior.Threshold2D Threshold2D , then this behavior does nothing;
otherwise, the following actions can be performed:
-
Rotation - Rotates the view platform. This is the default 2D
valuator action set by this behavior. Related properties are
RotationSpeed , RotationCoords ,
TransformCenterSource , and TransformCenter .
-
Translation - Translates the view platform. The translation
occurs relative to the X and Z basis vectors of either the 6DOF sensor or
the view platform if one is not available. The maximum speed is equal to
the product of the TranslationSpeed and
FastSpeedFactor property values.
-
Scale - Scales the view platform smaller with positive Y
values and larger with negative Y values. The effect is to increase the
apparent size of the virtual world when pushing the valuator forwards and
to decrease it when pushing backwards. Related properties are
ScaleSpeed , TransformCenterSource , and
TransformCenter .
WandViewBehavior.ButtonAction2D ButtonAction2D sets an action for a specific button
on the 2D valuator. The available actions are the same as for
ReadAction2D . No actions are bound by default to the 2D
valuator buttons.
The view transform may be reset to its home transform by pressing a number
of buttons simultaneously on the 6DOF sensor. The minimum number of
buttons that must be pressed is set by
WandViewBehavior.ResetViewButtonCount6DResetViewButtonCount6D . This value must be greater than one; the default
is three. This action may be disabled by setting the property value to
None. The corresponding property for the 2D valuator is
WandViewBehavior.ResetViewButtonCount2D ResetViewButtonCount2D , with a default value of
None. Note, however, that the reset view action will be ineffectual if an
action which always modifies the view transform is bound to reads on the
sensor used to reset the view, since the reset transform will get
overwritten by the read action.
The special value None can in general be assigned to any
button or read action to prevent any defaults from being bound to it.
See Also: ConfiguredUniverse See Also: SensorEventAgent since: Java 3D 1.3 |
Inner Class :public class GrabViewListener6D extends ListenerBase | |
Inner Class :public class TranslationListener6D extends ListenerBase | |
Inner Class :public class RotationListener6D extends ListenerBase | |
Inner Class :public class ScaleListener6D extends ListenerBase | |
Inner Class :public class RotationListener2D extends ListenerBase | |
Inner Class :public class TranslationListener2D extends ListenerBase | |
Inner Class :public class ScaleListener2D extends ListenerBase | |
Field Summary | |
final public static int | BEAM Indicates that the echo type is a beam extending from the
origin of the sensor's local coordinate system to its hotspot. | final public static int | DEGREES Indicates that rotation speed should be in degrees. | final public static int | ECHO Indicates that the 6DOF sensor read action should be bound to
displaying the sensor's echo in the virtual world. | final public static int | GNOMON Indicates that the echo type is a gnomon displaying the
directions of the sensor's local coordinate system axes at the location
of the sensor's hotspot. | final public static int | GRAB_VIEW Indicates that a 6DOF sensor button action should be bound
to grabbing the view. | final public static int | HEAD Indicates that rotation should occur in head coordinates. | final public static int | HOTSPOT Indicates that rotation or scale should be about a 6DOF sensor
hotspot. | final public static int | NONE Indicates a null configuration choice. | final public static int | PER_FRAME Indicates that translation, rotation, or scaling speeds are
per frame. | final public static int | PER_SECOND Use to indicate that translation, rotation, or scaling speeds are per
second. | final public static int | PHYSICAL_METERS Indicates that translation speed is in physical world units
(meters per second or per frame). | final public static int | RADIANS Indicates that rotation speed should be in radians. | final public static int | ROTATE_CCW Indicates that a 6DOF sensor button action should be bound
to rotate the view plaform counter-clockwise about a Y axis. | final public static int | ROTATE_CW Indicates that a 6DOF sensor button action should be bound
to rotate the view platform clockwise about a Y axis. | final public static int | ROTATION Indicates that a 2D sensor button or read action should be bound
to rotation. | final public static int | SCALE Indicates that a 2D sensor button or read action should be bound
to scaling. | final public static int | SCALE_DOWN Indicates that a 6DOF sensor button action should be bound
to scaling the view platform smaller. | final public static int | SCALE_UP Indicates that a 6DOF sensor button action should be bound
to scaling the view platform larger. | final public static int | SENSOR Indicates that rotation should occur in sensor coordinates. | final public static int | TRANSLATE_BACKWARD Indicates that a 6DOF sensor button action should be bound
to translating the view backward. | final public static int | TRANSLATE_FORWARD Indicates that a 6DOF sensor button action should be bound
to translating the view forward. | final public static int | TRANSLATION Indicates that a 2D sensor button or read action should be bound
to translation. | final public static int | VIEW_PLATFORM Indicates that rotation should occur in view platform
coordinates. | final public static int | VIRTUAL_UNITS Indicates that translation speed is in virtual world units. | final public static int | VWORLD_FIXED Indicates that rotation or scale should be about a fixed point
in virtual world coordinates. |
Constructor Summary | |
public | WandViewBehavior() Parameterless constructor for this behavior. | public | WandViewBehavior(Sensor sensor6D, Sensor sensor2D, int echoType, double echoSize) Creates a new instance with the specified sensors and echo parameters.
At least one sensor must be non-null .
This constructor should only be used if either
SimpleUniverse or ConfiguredUniverse is used
to set up the view side of the scene graph, or if it is otherwise to be
attached to a ViewingPlatform . | public | WandViewBehavior(Sensor sensor6D, Sensor sensor2D, TransformGroup echo) Creates a new instance with the specified sensors and a 6DOF sensor
echo parented by the specified TransformGroup . | public | WandViewBehavior(Sensor sensor6D, Sensor sensor2D, View view, TransformGroup viewTransform, Transform3D homeTransform, TransformGroup echo) Creates a new instance with the specified sensors and a 6DOF sensor
echo parented by the specified TransformGroup . |
Method Summary | |
public void | AccelerationTime(Object[] time) Property which sets the time interval for accelerating to the
translation, rotation, or scale speeds and for transitioning between
the normal and fast translation speeds. | public void | ButtonAction2D(Object[] action) Property which sets a button action for the 2D valuator. | public void | ButtonAction6D(Object[] action) Property which sets a button action for the 6DOF sensor. | public void | ConstantSpeedTime(Object[] time) Property which sets the time interval for which the translation occurs
at the normal speed. | public void | EchoColor(Object[] color) Property which sets the color of the 6DOF sensor echo. | public void | EchoSize(Object[] echoSize) Property which sets the size of the 6DOF sensor echo in physical
meters. | public void | EchoTransparency(Object[] transparency) Property which sets the 6DOF sensor echo transparency. | public void | EchoType(Object[] type) Property which sets the 6DOF sensor echo type. | public void | FastSpeedFactor(Object[] factor) Property which sets the fast translation speed factor. | public void | MatrixIndices2D(Object[] indices) Property which specifies where to find the X and Y values in the matrix
read generated by a 2D valuator. | public void | NominalSensorRotation(Object[] matrix) Property which sets the nominal sensor rotation. | public void | ReadAction2D(Object[] action) Property which sets the action to be bound to 2D valuator reads. | public void | ReadAction6D(Object[] action) Property which sets the action to be bound to 6DOF sensor reads. | public void | ResetViewButtonCount2D(Object[] count) Property which sets the number of buttons to be pressed simultaneously
on the 2D valuator in order to reset the view back to the home
transform. | public void | ResetViewButtonCount6D(Object[] count) Property which sets the number of buttons to be pressed simultaneously
on the 6DOF sensor in order to reset the view back to the home
transform. | public void | RotationCoords(Object[] coords) Property which sets the rotation coordinate system. | public void | RotationSpeed(Object[] speed) Property which sets the rotation speed. | public void | ScaleSpeed(Object[] speed) Property which sets the scaling speed. | public void | Sensor2D(Object[] sensor) Property which sets a 2D sensor for manipulating the view platform.
This is intended to support devices which incorporate a separate 2D
valuator along with the 6DOF sensor. | public void | Sensor6D(Object[] sensor) Property which sets a 6DOF sensor for manipulating the view platform.
This sensor must generate 6 degree of freedom orientation and position
data in physical meters relative to the sensor's tracker base.
This property is set in the configuration file. | public void | Threshold2D(Object[] threshold) Property which sets the threshold for 2D valuator reads. | public void | TransformCenter(Object[] center) Property which sets the center of rotation and scale if the
TransformCenterSource property is VworldFixed
or if a 6DOF sensor is not specified. | public void | TransformCenterSource(Object[] source) Property which sets the source of the center of rotation and scale.
The default is Hotspot , which means the center of rotation
or scale is a 6DOF sensor's current hotspot location. | public void | TranslationSpeed(Object[] speed) Property which sets the normal translation speed. | protected void | configureEcho() Creates a 6DOF sensor echo according to configuration parameters. | protected void | configureSensorActions() Creates the sensor listeners for a 6DOF sensor and/or a 2D valuator
sensor using the predefined button and read listeners and the
configured action bindings.
This is invoked the first time initialize is called. | public double | getAccelerationTime() Gets the time interval for accelerating to normal speed and for
transitioning between the normal and fast translation speeds. | public int | getButtonAction2D(int button) Gets the action associated with the specified button on the 2D valuator. | public int | getButtonAction6D(int button) Gets the action associated with the specified button on the 6DOF sensor. | public double | getConstantSpeedTime() Gets the time interval for which the translation occurs at the
normal speed. | public void | getEchoColor(Color3f color) Gets the 6DOF sensor echo color. | public Shape3D | getEchoGeometry() Gets the Shape3D defining the 6DOF sensor's echo geometry
and appearance. | public double | getEchoSize() Gets the size of the 6DOF sensor echo in meters. | public TransformGroup | getEchoTransformGroup() Gets the transform group containing a 6DOF sensor's echo geometry. | public float | getEchoTransparency() Gets the 6DOF sensor echo transparency value. | public int | getEchoType() Gets the echo type. | public double | getFastSpeedFactor() Gets the factor by which the normal translation speed is multiplied
after the constant speed time interval. | public int | getMatrixXIndex2D() Gets the index where the X value of a 2D valuator read matrix can be
found. | public int | getMatrixYIndex2D() Gets the index where the Y value of a 2D valuator read matrix can be
found. | public void | getNominalSensorRotation(Transform3D t3d) Gets the nominal sensor transform. | public int | getReadAction2D() Gets the configured 2D valuator read action. | public int | getReadAction6D() Gets the configured 6DOF sensor read action. | public int | getResetViewButtonCount2D() Gets the number of buttons to be pressed simultaneously on the 2D
valuator in order to reset the view back to the home transform. | public int | getResetViewButtonCount6D() Gets the number of buttons to be pressed simultaneously on the 6DOF
sensor in order to reset the view back to the home transform. | public int | getRotationCoords() Gets the rotation coordinate system. | public double | getRotationSpeed() Gets the rotation speed. | public int | getRotationTimeBase() Gets the time base for rotation speed. | public int | getRotationUnits() | public double | getScaleSpeed() Gets the scaling speed. | public int | getScaleTimeBase() Gets the time base for scaling speed. | public Sensor | getSensor2D() Returns a reference to the 2D valuator used for manipulating the view
platform. | public Sensor | getSensor6D() Returns a reference to the 6DOF sensor used for manipulating the view
platform. | public SensorEventAgent | getSensorEventAgent() Gets the SensorEventAgent used by this behavior. | public double | getThreshold2D() Gets the 2D valuator threshold. | public void | getTransformCenter(Point3d center) Gets the rotation/scale center in virtual world coordinates. | public int | getTransformCenterSource() Gets the rotation/scale center source. | public double | getTranslationSpeed() Gets the normal speed at which to translate the view platform. | public int | getTranslationTimeBase() Gets the time base for translation speed. | public int | getTranslationUnits() Gets the translation speed units. | public void | initialize() Initializes and configures this behavior.
NOTE: Applications should not call this method. | public void | processStimulus(Enumeration criteria) Processes a stimulus meant for this behavior. | public void | setAccelerationTime(double time) Sets the time interval for accelerating to the translation, rotation,
or scale speeds and for transitioning between the normal and fast
translation speeds. | public synchronized void | setButtonAction2D(int button, int action) Sets a button action for the 2D valuator. | public synchronized void | setButtonAction6D(int button, int action) Sets a button action for the 6DOF sensor. | public void | setConstantSpeedTime(double time) Sets the time interval for which the translation occurs at the normal
speed. | public void | setEchoColor(Color3f color) Sets the color of the 6DOF sensor echo. | public void | setEchoSize(double echoSize) Sets the size of the 6DOF sensor echo in physical meters. | public void | setEchoTransformGroup(TransformGroup echo) Sets the transform group containing a 6DOF sensor's echo geometry.
This is used to specify a custom echo. | public void | setEchoTransparency(float transparency) Sets the 6DOF sensor echo transparency. | public void | setEchoType(int type) Sets the 6DOF sensor echo type. | public void | setEnable(boolean enable) Enables or disables this behavior. | public void | setFastSpeedFactor(double factor) Sets the fast translation speed factor. | public void | setMatrixIndices2D(int xIndex, int yIndex) Specifies where to find the X and Y values in the matrix read generated
by a 2D valuator. | public void | setNominalSensorRotation(Transform3D transform) Sets the nominal sensor transform. | public void | setReadAction2D(int action) Sets the action to be bound to 2D valuator reads. | public void | setReadAction6D(int action) Sets the action to be bound to 6DOF sensor reads. | public void | setResetViewButtonCount2D(int count) Sets the number of buttons to be pressed simultaneously on the 2D
valuator in order to reset the view back to the home transform. | public void | setResetViewButtonCount6D(int count) Sets the number of buttons to be pressed simultaneously
on the 6DOF sensor in order to reset the view back to the home
transform. | public void | setRotationCoords(int coords) Sets the rotation coordinate system. | public void | setRotationSpeed(double speed, int units, int timeBase) Sets the rotation speed. | public void | setScaleSpeed(double speed, int timeBase) Sets the scaling speed. | public void | setThreshold2D(double threshold) Sets the threshold for 2D valuator reads. | public void | setTransformCenter(Point3d center) Sets the center of rotation and scale if
setTransformCenterSource is called with
VWORLD_FIXED or if a 6DOF sensor is not specified. | public void | setTransformCenterSource(int source) Sets the source of the center of rotation and scale. | public void | setTranslationSpeed(double speed, int units, int timeBase) Sets the normal translation speed. | public void | setViewingPlatform(ViewingPlatform vp) Sets the ViewingPlatform for this behavior. | protected void | updateEcho(Sensor sensor, Transform3D sensorToVworld) Updates the echo position and orientation. |
BEAM | final public static int BEAM(Code) | | Indicates that the echo type is a beam extending from the
origin of the sensor's local coordinate system to its hotspot.
|
DEGREES | final public static int DEGREES(Code) | | Indicates that rotation speed should be in degrees. This is the
default.
|
ECHO | final public static int ECHO(Code) | | Indicates that the 6DOF sensor read action should be bound to
displaying the sensor's echo in the virtual world. This is the
default.
|
GNOMON | final public static int GNOMON(Code) | | Indicates that the echo type is a gnomon displaying the
directions of the sensor's local coordinate system axes at the location
of the sensor's hotspot.
|
GRAB_VIEW | final public static int GRAB_VIEW(Code) | | Indicates that a 6DOF sensor button action should be bound
to grabbing the view. The default is button 0.
|
HEAD | final public static int HEAD(Code) | | Indicates that rotation should occur in head coordinates.
|
HOTSPOT | final public static int HOTSPOT(Code) | | Indicates that rotation or scale should be about a 6DOF sensor
hotspot. This is the default.
|
NONE | final public static int NONE(Code) | | Indicates a null configuration choice.
|
PER_FRAME | final public static int PER_FRAME(Code) | | Indicates that translation, rotation, or scaling speeds are
per frame.
|
PER_SECOND | final public static int PER_SECOND(Code) | | Use to indicate that translation, rotation, or scaling speeds are per
second. This is the default.
|
PHYSICAL_METERS | final public static int PHYSICAL_METERS(Code) | | Indicates that translation speed is in physical world units
(meters per second or per frame). This is the default.
|
RADIANS | final public static int RADIANS(Code) | | Indicates that rotation speed should be in radians.
|
ROTATE_CCW | final public static int ROTATE_CCW(Code) | | Indicates that a 6DOF sensor button action should be bound
to rotate the view plaform counter-clockwise about a Y axis.
|
ROTATE_CW | final public static int ROTATE_CW(Code) | | Indicates that a 6DOF sensor button action should be bound
to rotate the view platform clockwise about a Y axis.
|
ROTATION | final public static int ROTATION(Code) | | Indicates that a 2D sensor button or read action should be bound
to rotation. The default is to bind rotation to the 2D sensor reads.
|
SCALE | final public static int SCALE(Code) | | Indicates that a 2D sensor button or read action should be bound
to scaling.
|
SCALE_DOWN | final public static int SCALE_DOWN(Code) | | Indicates that a 6DOF sensor button action should be bound
to scaling the view platform smaller.
|
SCALE_UP | final public static int SCALE_UP(Code) | | Indicates that a 6DOF sensor button action should be bound
to scaling the view platform larger.
|
SENSOR | final public static int SENSOR(Code) | | Indicates that rotation should occur in sensor coordinates.
This is the default.
|
TRANSLATE_BACKWARD | final public static int TRANSLATE_BACKWARD(Code) | | Indicates that a 6DOF sensor button action should be bound
to translating the view backward. The default is button 2.
|
TRANSLATE_FORWARD | final public static int TRANSLATE_FORWARD(Code) | | Indicates that a 6DOF sensor button action should be bound
to translating the view forward. The default is button 1.
|
TRANSLATION | final public static int TRANSLATION(Code) | | Indicates that a 2D sensor button or read action should be bound
to translation.
|
VIEW_PLATFORM | final public static int VIEW_PLATFORM(Code) | | Indicates that rotation should occur in view platform
coordinates.
|
VIRTUAL_UNITS | final public static int VIRTUAL_UNITS(Code) | | Indicates that translation speed is in virtual world units.
|
VWORLD_FIXED | final public static int VWORLD_FIXED(Code) | | Indicates that rotation or scale should be about a fixed point
in virtual world coordinates.
|
WandViewBehavior | public WandViewBehavior()(Code) | | Parameterless constructor for this behavior. This is called when this
behavior is instantiated from a configuration file.
Syntax: (NewViewPlatformBehavior <name>
com.sun.j3d.utils.behaviors.vp.WandViewBehavior)
|
WandViewBehavior | public WandViewBehavior(Sensor sensor6D, Sensor sensor2D, int echoType, double echoSize)(Code) | | Creates a new instance with the specified sensors and echo parameters.
At least one sensor must be non-null .
This constructor should only be used if either
SimpleUniverse or ConfiguredUniverse is used
to set up the view side of the scene graph, or if it is otherwise to be
attached to a ViewingPlatform . If this behavior is not
instantiated from a configuration file then it must then be explicitly
attached to a ViewingPlatform instance with the
ViewingPlatform.setViewPlatformBehavior method.
Parameters: sensor6D - a six degree of freedom sensor which generates readsrelative to the tracker base in physical units; may benull Parameters: sensor2D - 2D valuator which generates X and Y reads ranging from[-1.0 .. +1.0]; may be null Parameters: echoType - either GNOMON , BEAM , orNONE for the 6DOF sensor echo Parameters: echoSize - the width of the 6DOF sensor echo in physical meters;ignored if echoType is NONE |
WandViewBehavior | public WandViewBehavior(Sensor sensor6D, Sensor sensor2D, TransformGroup echo)(Code) | | Creates a new instance with the specified sensors and a 6DOF sensor
echo parented by the specified TransformGroup . At least
one sensor must be non-null .
This constructor should only be used if either
SimpleUniverse or ConfiguredUniverse is used
to set up the view side of the scene graph, or if it is otherwise to be
attached to a ViewingPlatform . If this behavior is not
instantiated from a configuration file then it must then be explicitly
attached to a ViewingPlatform instance with the
ViewingPlatform.setViewPlatformBehavior method.
If the echo TransformGroup is non-null , it
will be added to a new BranchGroup and attached to the
ViewingPlatform , where its transform will be updated in
response to the sensor reads. Capabilities to allow writing its
transform and to read, write, and extend its children will be set. The
echo geometry is assumed to incorporate the position and orientation of
the 6DOF sensor hotspot.
Parameters: sensor6D - a six degree of freedom sensor which generates readsrelative to the tracker base in physical units; may benull Parameters: sensor2D - 2D valuator which generates X and Y reads ranging from[-1.0 .. +1.0]; may be null Parameters: echo - a TransformGroup containing the visible echowhich will track the 6DOF sensor's position and orientation, ornull for no echo |
WandViewBehavior | public WandViewBehavior(Sensor sensor6D, Sensor sensor2D, View view, TransformGroup viewTransform, Transform3D homeTransform, TransformGroup echo)(Code) | | Creates a new instance with the specified sensors and a 6DOF sensor
echo parented by the specified TransformGroup . At least
one sensor must be non-null .
This constructor should only be used if SimpleUniverse or
ConfiguredUniverse is not used to set up the view
side of the scene graph. The application must set up the view side
itself and supply references to the View and the
TransformGroup containing the view platform transform.
ViewingPlatform.setViewPlatformBehavior must not
be called, and this behavior must be explicitly added to the virtual
universe by the application.
If the echo TransformGroup is non-null , it
will only be used to update its associated transform with the position
and orientation of a 6DOF sensor (if supplied). The application is
responsible for adding the echo to the virtual universe. The echo
geometry is assumed to incorporate the position and orientation of the
6DOF sensor hotspot.
Parameters: sensor6D - a six degree of freedom sensor which generates readsrelative to the tracker base in physical units; may benull Parameters: sensor2D - 2D valuator which generates X and Y reads ranging from[-1.0 .. +1.0]; may be null Parameters: view - a reference to the View attached to the ViewPlatform to be manipulated by this behavior Parameters: viewTransform - a TransformGroup containing the viewplatform transform; appropriate capabilities to update the transformmust be set Parameters: homeTransform - a Transform3D containing theview transform to be used when the view is reset; may benull for identity Parameters: echo - a TransformGroup containing the visible echowhich will track the 6DOF sensor's position and orientation, ornull for no echo; appropriate capabilities to update thetransform must be set |
AccelerationTime | public void AccelerationTime(Object[] time)(Code) | | Property which sets the time interval for accelerating to the
translation, rotation, or scale speeds and for transitioning between
the normal and fast translation speeds. The default is 1 second. This
property is set in the configuration file read by
ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
AccelerationTime <seconds>)
Parameters: time - array of length 1 containing a Double See Also: WandViewBehavior.setAccelerationTime |
ButtonAction6D | public void ButtonAction6D(Object[] action)(Code) | | Property which sets a button action for the 6DOF sensor. The choices
are TranslateForward , TranslateBackward ,
GrabView , RotateCCW , RotateCW ,
ScaleUp , ScaleDown , or None . By
default, button 0 is bound to GrabView , button 1 is bound
to TranslateForward , and button 2 is bound to
TranslateBackward . If there are fewer than three buttons
available, then the default button actions with the lower button
indices have precedence. A value of None indicates that
no default action is to be associated with the specified button.
TranslateForward moves the view platform forward along the
direction the sensor is pointing. TranslateBackward does
the same, in the opposite direction. GrabView directly
manipulates the view by moving it in inverse response to the sensor's
position and orientation. RotateCCW and
RotateCW rotate about a Y axis, while ScaleUp
and ScaleDown scale the view platform larger and smaller.
Specifying a button index that is greater than that available with the
6DOF sensor will result in an ArrayOutOfBoundsException
when the behavior is initialized or attached to a
ViewingPlatform .
This property is set in the configuration file read by
ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
ButtonAction6D <button index>
[GrabView | TranslateForward | TranslateBackward | RotateCCW |
RotateCW | ScaleUp | ScaleDown | None])
Parameters: action - array of length 2 containing a Double and aString . See Also: WandViewBehavior.setButtonAction6D See Also: WandViewBehavior.Sensor6D See Also: Sensor6D See Also: WandViewBehavior.TranslationSpeed See Also: TranslationSpeed See Also: WandViewBehavior.AccelerationTime See Also: AccelerationTime See Also: WandViewBehavior.ConstantSpeedTime See Also: ConstantSpeedTime See Also: WandViewBehavior.FastSpeedFactor See Also: FastSpeedFactor See Also: WandViewBehavior.RotationSpeed See Also: RotationSpeed See Also: WandViewBehavior.RotationCoords See Also: RotationCoords See Also: WandViewBehavior.ScaleSpeed See Also: ScaleSpeed See Also: WandViewBehavior.TransformCenterSource See Also: TransformCenterSource See Also: WandViewBehavior.TransformCenter See Also: TransformCenter See Also: GrabViewListener6D See Also: TranslationListener6D See Also: RotationListener6D See Also: ScaleListener6D |
ConstantSpeedTime | public void ConstantSpeedTime(Object[] time)(Code) | | Property which sets the time interval for which the translation occurs
at the normal speed. The default is 8 seconds. This property is set
in the configuration file read by ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
ConstantSpeedTime <seconds>)
Parameters: time - array of length 1 containing a Double See Also: WandViewBehavior.setConstantSpeedTime |
EchoColor | public void EchoColor(Object[] color)(Code) | | Property which sets the color of the 6DOF sensor echo. The default is
white. This property is set in the configuration file read by
ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
EchoColor <red> <green> <blue>)
Parameters: color - array of length 3 containing Doubles See Also: WandViewBehavior.setEchoColor |
EchoSize | public void EchoSize(Object[] echoSize)(Code) | | Property which sets the size of the 6DOF sensor echo in physical
meters. This is used for the width of the gnomon and beam echoes. The
default is 1 centimeter. This property is set in the configuration
file read by ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
EchoSize <size>)
Parameters: echoSize - array of length 1 containing a Double See Also: WandViewBehavior.setEchoSize |
EchoTransparency | public void EchoTransparency(Object[] transparency)(Code) | | Property which sets the 6DOF sensor echo transparency. The default is
opaque. A value of 0.0 is fully opaque and 1.0 is fully transparent.
This property is set in the configuration file read by
ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
EchoTransparency <transparency>)
Parameters: transparency - array of length 1 containing a Double See Also: WandViewBehavior.setEchoTransparency |
EchoType | public void EchoType(Object[] type)(Code) | | Property which sets the 6DOF sensor echo type. The default is
Gnomon , which displays an object with points indicating
the direction of each of the sensor's coordinate system axes at the
location of the sensor's hotspot. The alternative is
Beam , which displays a beam from the sensor's origin to
the location of the sensor's hotspot; the hotspot must not be (0, 0, 0)
or an IllegalArgumentException will result. The width of
each of these echo types is specified by the EchoSize
property. The EchoType property is set in the
configuration file read by ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
EchoType [Gnomon | Beam | None])
Parameters: type - array of length 1 containing a String See Also: WandViewBehavior.setEchoType |
FastSpeedFactor | public void FastSpeedFactor(Object[] factor)(Code) | | Property which sets the fast translation speed factor. The default is
10 times the normal speed. This property is set in the configuration
file read by ConfiguredUniverse.
Syntax: (ViewPlatformBehaviorProperty <name>
FastSpeedFactor <factor>)
Parameters: factor - array of length 1 containing a Double See Also: WandViewBehavior.setFastSpeedFactor |
MatrixIndices2D | public void MatrixIndices2D(Object[] indices)(Code) | | Property which specifies where to find the X and Y values in the matrix
read generated by a 2D valuator. The defaults are along the
translation components of the matrix, at indices 3 and 7. This
property is set in the configuration file read by
ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
MatrixIndices2D <X index> <Y index>)
Parameters: indices - array of length 2 containing Doubles See Also: WandViewBehavior.setMatrixIndices2D |
NominalSensorRotation | public void NominalSensorRotation(Object[] matrix)(Code) | | Property which sets the nominal sensor rotation. The default is the
identity transform.
This behavior assumes that when a hand-held wand is pointed directly at
a screen in an upright position, then its 6DOF sensor's local
coordinate system axes (its basis vectors) are nominally aligned with
the image plate basis vectors; specifically, that the sensor's -Z axis
points toward the screen, the +Y axis points up, and the +X axis points
to the right. The translation and rotation listeners provided by this
behavior assume this orientation to determine the transforms to be
applied to the view platform; for example, translation applies along
the sensor Z axis, while rotation applies about axes defined in the
sensor XY plane.
This nominal alignment may not hold true depending upon how the sensor
is mounted and how the specific InputDevice supporting the
sensor handles its orientation. The NominalSensorRotation
property can be used to correct the alignment by specifying the
rotation needed to transform vectors from the nominal sensor coordinate
system, aligned with the image plate coordinate system as described
above, to the sensor's actual local coordinate system.
NOTE: the nominal sensor transform applies only to the
translation directions and rotation axes created by the listeners
defined in this behavior; for compatibility with the core Java 3D API,
sensor reads and the sensor hotspot location are still expressed in the
sensor's local coordinate system.
This property is set in the configuration file read by
ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
NominalSensorRotation [<Matrix4d> |
<Matrix3d>])
Parameters: matrix - array of length 1 containing a Matrix4d orMatrix3d See Also: WandViewBehavior.setNominalSensorRotation |
ReadAction2D | public void ReadAction2D(Object[] action)(Code) | | Property which sets the action to be bound to 2D valuator reads. This
action will be performed on each frame whenever no button actions have
been invoked and the valuator read value is greater than the threshold
range specified by the Threshold2D property.
The X and Y values from the valuator should have a continuous range
from -1.0 to +1.0, although speeds can be scaled to compensate for a
different range. The X and Y values are found in the sensor's read
matrix at the indices specified by MatrixIndices2D , with
defaults of 3 and 7 respectively.
The default property value of Rotation rotates the view
platform in the direction the valuator is pushed. The rotation
coordinate system is set by the RotationCoords property,
with a default of Sensor . The rotation occurs about a
point in the virtual world set by the
TransformCenterSource and TransformCenter
properties, with the default set to rotate about the hotspot of a 6DOF
sensor, if one is available, or about the origin of the virtual world
if not. The rotation speed is scaled by the valuator read value up to
the maximum speed set with the RotationSpeed property; the
default is 180 degrees per second.
A property value of Translation moves the view platform in
the direction the valuator is pushed. The translation occurs along the
X and Z basis vectors of either a 6DOF sensor or the view platform if a
6DOF sensor is not specified. The translation speed is scaled by the
valuator read value up to a maximum set by the product of the
TranslationSpeed and FastSpeedFactor property
values.
If this property value is to Scale , then the view platform
is scaled smaller or larger when the valuator is pushed forward or
backward. The scaling occurs about a point in the virtual world set by
the TransformCenterSource and TransformCenter
properties. The scaling speed is set with the ScaleSpeed
property, with a default scale factor of 2.0 per second at the extreme
negative range of -1.0, and a factor of 0.5 per second at the extreme
positive range of +1.0.
A value of None prevents Rotation from being
bound to the 2D valuator reads.
This property is set in the configuration file read by
ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
ReadAction2D [Rotation | Translation | Scale | None])
Parameters: action - array of length 1 containing a String See Also: WandViewBehavior.setReadAction2D See Also: WandViewBehavior.RotationCoords See Also: RotationCoords See Also: WandViewBehavior.RotationSpeed See Also: RotationSpeed See Also: WandViewBehavior.TransformCenterSource See Also: TransformCenterSource See Also: WandViewBehavior.TransformCenter See Also: TransformCenter See Also: WandViewBehavior.TranslationSpeed See Also: TranslationSpeed See Also: WandViewBehavior.FastSpeedFactor See Also: FastSpeedFactor See Also: WandViewBehavior.ScaleSpeed See Also: ScaleSpeed See Also: WandViewBehavior.MatrixIndices2D See Also: MatrixIndices2D See Also: RotationListener2D See Also: TranslationListener2D See Also: ScaleListener2D |
ReadAction6D | public void ReadAction6D(Object[] action)(Code) | | Property which sets the action to be bound to 6DOF sensor reads. This
action will be performed every frame whenever a button action has not
been invoked.
The default is Echo , which displays a geometric
representation of the sensor's current position and orientation in the
virtual world. A value of None indicates that no default
action is to be applied to the sensor's read.
This property is set in the configuration file read by
ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
ReadAction6D [Echo | None])
Parameters: action - array of length 1 containing a String See Also: WandViewBehavior.setReadAction6D See Also: EchoReadListener6D |
ResetViewButtonCount2D | public void ResetViewButtonCount2D(Object[] count)(Code) | | Property which sets the number of buttons to be pressed simultaneously
on the 2D valuator in order to reset the view back to the home
transform. The value must be greater than 1; the default is
None . A value of None disables this action.
This property is set in the configuration file read by
ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
ResetViewButtonCount2D [<count> | None])
Parameters: count - array of length 1 containing a Double orString See Also: WandViewBehavior.setResetViewButtonCount2D See Also: ViewPlatformBehavior.setHomeTransform See Also: ViewPlatformBehavior.setHomeTransform |
ResetViewButtonCount6D | public void ResetViewButtonCount6D(Object[] count)(Code) | | Property which sets the number of buttons to be pressed simultaneously
on the 6DOF sensor in order to reset the view back to the home
transform. The value must be greater than 1; the default is 3. A
value of None disables this action. This property is set
in the configuration file read by ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
ResetViewButtonCount6D [<count> | None])
Parameters: count - array of length 1 containing a Double orString See Also: WandViewBehavior.setResetViewButtonCount6D See Also: ViewPlatformBehavior.setHomeTransform See Also: ViewPlatformBehavior.setHomeTransform |
RotationCoords | public void RotationCoords(Object[] coords)(Code) | | Property which sets the rotation coordinate system. The default is
Sensor , which means that the rotation axis is parallel to
the XY plane of the current orientation of a specified 6DOF sensor. A
value of ViewPlatform means the rotation axis is parallel
to the XY plane of the view platform. The latter is also the fallback
if a 6DOF sensor is not specified. If the value is Head ,
then the rotation occurs in head coordinates.
This property is set in the configuration file read by
ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
RotationCoords [Sensor | ViewPlatform | Head])
Parameters: coords - array of length 1 containing a String See Also: WandViewBehavior.setRotationCoords |
RotationSpeed | public void RotationSpeed(Object[] speed)(Code) | | Property which sets the rotation speed. The default is 180
degrees/second. This property is set in the configuration file read by
ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
RotationSpeed <speed> [Degrees | Radians]
[PerFrame | PerSecond])
Parameters: speed - array of length 3; first element is a Double for the speed, the second is a String for the units, andthe third is a String for the time base See Also: WandViewBehavior.setRotationSpeed |
ScaleSpeed | public void ScaleSpeed(Object[] speed)(Code) | | Property which sets the scaling speed. The default is 2.0 per second,
which means magnification doubles the apparent size of the virtual
world every second, and minification halves the apparent size of the
virtual world every second.
The scaling applied with each frame is Math.pow(scaleSpeed,
frameTime) , where frameTime is the time in seconds
that the last frame took to render if the time base is
PerSecond , or 1.0 if the time base is
PerFrame . If scaling is performed with the 2D valuator,
then the valuator's Y value as specified by
MatrixIndices2D is an additional scale applied to the
exponent. If scaling is performed by the 6DOF sensor, then the scale
speed can be inverted with a negative exponent by using the appropriate
listener constructor flag.
This property is set in the configuration file read by
ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
ScaleSpeed <speed> [PerFrame | PerSecond])
Parameters: speed - array of length 2; first element is a Double for the speed, and the second is a String for the timebase See Also: WandViewBehavior.setScaleSpeed |
Sensor2D | public void Sensor2D(Object[] sensor)(Code) | | Property which sets a 2D sensor for manipulating the view platform.
This is intended to support devices which incorporate a separate 2D
valuator along with the 6DOF sensor. The X and Y values from the
valuator should have a continuous range from -1.0 to +1.0, although
rotation, translation, and scaling speeds can be scaled to compensate
for a different range. The X and Y values are found in the sensor's
read matrix at the indices specified by the
MatrixIndices2D property, with defaults of 3 and 7
(the X and Y translation components) respectively.
This property is set in the configuration file. The first command form
assumes that a ViewingPlatform is being used and that the
sensor name can be looked up from a ConfiguredUniverse
reference retrieved from ViewingPlatform.getUniverse . The
second form is preferred and accepts the Sensor reference directly.
Syntax: (ViewPlatformBehaviorProperty <name>
Sensor2D <sensorName>)
Alternative Syntax: (ViewPlatformBehaviorProperty
<name> Sensor2D (Sensor <sensorName>))
Parameters: sensor - array of length 1 containing a String ora Sensor |
Sensor6D | public void Sensor6D(Object[] sensor)(Code) | | Property which sets a 6DOF sensor for manipulating the view platform.
This sensor must generate 6 degree of freedom orientation and position
data in physical meters relative to the sensor's tracker base.
This property is set in the configuration file. The first command form
assumes that a ViewingPlatform is being used and that the
sensor name can be looked up from a ConfiguredUniverse
reference retrieved from ViewingPlatform.getUniverse . The
second form is preferred and accepts the Sensor reference directly.
Syntax: (ViewPlatformBehaviorProperty <name>
Sensor6D <sensorName>)
Alternative Syntax: (ViewPlatformBehaviorProperty
<name> Sensor6D (Sensor <sensorName>))
Parameters: sensor - array of length 1 containing a String ora Sensor |
Threshold2D | public void Threshold2D(Object[] threshold)(Code) | | Property which sets the threshold for 2D valuator reads. The default
is 0.0. It can be set higher to handle noisy valuators. This property
is set in the configuration file read by
ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
Threshold2D <threshold>)
Parameters: threshold - array of length 1 containing a Double See Also: WandViewBehavior.setThreshold2D |
TransformCenter | public void TransformCenter(Object[] center)(Code) | | Property which sets the center of rotation and scale if the
TransformCenterSource property is VworldFixed
or if a 6DOF sensor is not specified. The default is (0.0, 0.0, 0.0)
in virtual world coordinates. This property is set in the
configuration file read by ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
TransformCenter <Point3d>)
Parameters: center - array of length 1 containing a Point3d See Also: WandViewBehavior.setTransformCenter |
TransformCenterSource | public void TransformCenterSource(Object[] source)(Code) | | Property which sets the source of the center of rotation and scale.
The default is Hotspot , which means the center of rotation
or scale is a 6DOF sensor's current hotspot location. The alternative
is VworldFixed , which uses the fixed virtual world
coordinates specified by the TransformCenter property as
the center. The latter is also the fallback if a 6DOF sensor is not
specified. This property is set in the configuration file read by
ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
TransformCenterSource [Hotspot | VworldFixed])
Parameters: source - array of length 1 containing a String See Also: WandViewBehavior.setTransformCenterSource |
TranslationSpeed | public void TranslationSpeed(Object[] speed)(Code) | | Property which sets the normal translation speed. The default is 0.1
meters/second in physical units. This property is set in the
configuration file read by ConfiguredUniverse .
Syntax: (ViewPlatformBehaviorProperty <name>
TranslationSpeed <speed> [PhysicalMeters | VirtualUnits]
[PerFrame | PerSecond])
Parameters: speed - array of length 3; first element is a Double for the speed, the second is a String for the units, andthe third is a String for the time base See Also: WandViewBehavior.setTranslationSpeed |
configureEcho | protected void configureEcho()(Code) | | Creates a 6DOF sensor echo according to configuration parameters. This
is done only if a 6DOF sensor has been specified, the 6DOF sensor read
action has been set to echo the sensor position, the echo transform
group has not already been set, and a ViewingPlatform is in use. This
is invoked the first time initialize is called to set this
behavior live, but before the echo transform group is added to a
BranchGroup and made live. This method can be overridden
to support other echo geometry.
|
configureSensorActions | protected void configureSensorActions()(Code) | | Creates the sensor listeners for a 6DOF sensor and/or a 2D valuator
sensor using the predefined button and read listeners and the
configured action bindings.
This is invoked the first time initialize is called. This
method can be overridden by subclasses to modify the configured
bindings or introduce other configuration parameters.
|
getAccelerationTime | public double getAccelerationTime()(Code) | | Gets the time interval for accelerating to normal speed and for
transitioning between the normal and fast translation speeds.
the acceleration time |
getButtonAction2D | public int getButtonAction2D(int button)(Code) | | Gets the action associated with the specified button on the 2D valuator.
the action associated with the button |
getButtonAction6D | public int getButtonAction6D(int button)(Code) | | Gets the action associated with the specified button on the 6DOF sensor.
the action associated with the button |
getConstantSpeedTime | public double getConstantSpeedTime()(Code) | | Gets the time interval for which the translation occurs at the
normal speed.
the constant speed time |
getEchoColor | public void getEchoColor(Color3f color)(Code) | | Gets the 6DOF sensor echo color.
Parameters: color - the Color3f into which to copy the echo color |
getEchoGeometry | public Shape3D getEchoGeometry()(Code) | | Gets the Shape3D defining the 6DOF sensor's echo geometry
and appearance. The returned Shape3D allows appearance
read and write. If a custom echo was supplied by providing the echo
transform group directly then the return value will be
null .
the echo geometry, or null if a custom echo wassupplied |
getEchoSize | public double getEchoSize()(Code) | | Gets the size of the 6DOF sensor echo in meters.
the echo size |
getEchoTransformGroup | public TransformGroup getEchoTransformGroup()(Code) | | Gets the transform group containing a 6DOF sensor's echo geometry.
Capabilities to write its transform and read, write, and extend its
children are granted.
the echo's transform group |
getEchoTransparency | public float getEchoTransparency()(Code) | | Gets the 6DOF sensor echo transparency value.
the transparency value |
getEchoType | public int getEchoType()(Code) | | Gets the echo type.
the echo type |
getFastSpeedFactor | public double getFastSpeedFactor()(Code) | | Gets the factor by which the normal translation speed is multiplied
after the constant speed time interval.
the fast speed factor |
getMatrixXIndex2D | public int getMatrixXIndex2D()(Code) | | Gets the index where the X value of a 2D valuator read matrix can be
found.
the X index in the read matrix |
getMatrixYIndex2D | public int getMatrixYIndex2D()(Code) | | Gets the index where the Y value of a 2D valuator read matrix can be
found.
the Y index in the read matrix |
getNominalSensorRotation | public void getNominalSensorRotation(Transform3D t3d)(Code) | | Gets the nominal sensor transform.
Parameters: t3d - Transform3D to receive a copy of thenominal sensor transform |
getReadAction2D | public int getReadAction2D()(Code) | | Gets the configured 2D valuator read action.
the action associated with the sensor read |
getReadAction6D | public int getReadAction6D()(Code) | | Gets the configured 6DOF sensor read action.
the configured 6DOF sensor read action |
getResetViewButtonCount2D | public int getResetViewButtonCount2D()(Code) | | Gets the number of buttons to be pressed simultaneously on the 2D
valuator in order to reset the view back to the home transform. A value
of NONE indicates this action is disabled.
the number of buttons to press simultaneously for a view reset |
getResetViewButtonCount6D | public int getResetViewButtonCount6D()(Code) | | Gets the number of buttons to be pressed simultaneously on the 6DOF
sensor in order to reset the view back to the home transform. A value
of NONE indicates this action is disabled.
the number of buttons to press simultaneously for a view reset |
getRotationCoords | public int getRotationCoords()(Code) | | Gets the rotation coordinate system.
the rotation coordinate system |
getRotationSpeed | public double getRotationSpeed()(Code) | | Gets the rotation speed.
the rotation speed |
getRotationTimeBase | public int getRotationTimeBase()(Code) | | Gets the time base for rotation speed.
the rotation time base |
getRotationUnits | public int getRotationUnits()(Code) | | Gets the rotation speed units
the rotation units |
getScaleSpeed | public double getScaleSpeed()(Code) | | Gets the scaling speed.
the scaling speed |
getScaleTimeBase | public int getScaleTimeBase()(Code) | | Gets the time base for scaling speed.
the scaling time base |
getSensor2D | public Sensor getSensor2D()(Code) | | Returns a reference to the 2D valuator used for manipulating the view
platform.
the 2D valuator |
getSensor6D | public Sensor getSensor6D()(Code) | | Returns a reference to the 6DOF sensor used for manipulating the view
platform.
the 6DOF sensor |
getSensorEventAgent | public SensorEventAgent getSensorEventAgent()(Code) | | Gets the SensorEventAgent used by this behavior. Sensor
event generation is delegated to this agent. This can be accessed to
manipulate the sensor button and read action bindings directly.
the sensor event agent |
getThreshold2D | public double getThreshold2D()(Code) | | Gets the 2D valuator threshold.
the threshold value |
getTransformCenter | public void getTransformCenter(Point3d center)(Code) | | Gets the rotation/scale center in virtual world coordinates.
Parameters: center - Point3d to receive a copy of therotation/scale center |
getTransformCenterSource | public int getTransformCenterSource()(Code) | | Gets the rotation/scale center source.
the rotation/scale center source |
getTranslationSpeed | public double getTranslationSpeed()(Code) | | Gets the normal speed at which to translate the view platform.
the normal translation speed |
getTranslationTimeBase | public int getTranslationTimeBase()(Code) | | Gets the time base for translation speed.
the translation time base |
getTranslationUnits | public int getTranslationUnits()(Code) | | Gets the translation speed units.
the translation units |
initialize | public void initialize()(Code) | | Initializes and configures this behavior.
NOTE: Applications should not call this method. It is called by
the Java 3D behavior scheduler.
|
processStimulus | public void processStimulus(Enumeration criteria)(Code) | | Processes a stimulus meant for this behavior.
NOTE: Applications should not call this method. It is called by
the Java 3D behavior scheduler.
|
setAccelerationTime | public void setAccelerationTime(double time)(Code) | | Sets the time interval for accelerating to the translation, rotation,
or scale speeds and for transitioning between the normal and fast
translation speeds. The default is 1 second.
Parameters: time - number of seconds to accelerate to normal or fast speed |
setButtonAction6D | public synchronized void setButtonAction6D(int button, int action)(Code) | | Sets a button action for the 6DOF sensor. The choices are
TRANSLATE_FORWARD , TRANSLATE_BACKWARD ,
GRAB_VIEW , ROTATE_CCW ,
ROTATE_CW , SCALE_UP , SCALE_DOWN ,
or NONE . By default, button 0 is bound to
GRAB_VIEW , button 1 is bound to
TRANSLATE_FORWARD , and button 2 is bound to
TRANSLATE_BACKWARD . If there are fewer than three buttons
available, then the default button actions with the lower button
indices have precedence. A value of NONE indicates that
no default action is to be associated with the specified button.
TRANSLATE_FORWARD moves the view platform forward along
the direction the sensor is pointing. TRANSLATE_BACKWARD
does the same, in the opposite direction. GRAB_VIEW
directly manipulates the view by moving it in inverse response to the
sensor's position and orientation. ROTATE_CCW and
ROTATE_CW rotate about a Y axis, while
SCALE_UP and SCALE_DOWN scale the view
platform larger and smaller.
Specifying a button index that is greater that that available with the
6DOF sensor will result in an ArrayOutOfBoundsException
when the behavior is initialized or attached to a
ViewingPlatform .
This method only configures the button listeners pre-defined by
this behavior. For complete control over the button actions, access
the SensorEventAgent used by this behavior directly.
Parameters: button - index of the button to bind Parameters: action - either TRANSLATE_FORWARD ,TRANSLATE_BACKWARD , GRAB_VIEW ,ROTATE_CCW , ROTATE_CW, SCALE_UP ,SCALE_DOWN , or NONE See Also: WandViewBehavior.setTranslationSpeed See Also: WandViewBehavior.setAccelerationTime See Also: WandViewBehavior.setConstantSpeedTime See Also: WandViewBehavior.setFastSpeedFactor See Also: WandViewBehavior.setRotationSpeed See Also: WandViewBehavior.setRotationCoords See Also: WandViewBehavior.setScaleSpeed See Also: WandViewBehavior.setTransformCenterSource See Also: WandViewBehavior.setTransformCenter See Also: WandViewBehavior.getSensorEventAgent See Also: GrabViewListener6D See Also: TranslationListener6D See Also: RotationListener6D See Also: ScaleListener6D |
setConstantSpeedTime | public void setConstantSpeedTime(double time)(Code) | | Sets the time interval for which the translation occurs at the normal
speed. The default is 8 seconds.
Parameters: time - number of seconds to translate at a constant speed |
setEchoColor | public void setEchoColor(Color3f color)(Code) | | Sets the color of the 6DOF sensor echo. The default is white. This
can be called to set the color before or after the echo geometry is
created.
Parameters: color - the echo color |
setEchoSize | public void setEchoSize(double echoSize)(Code) | | Sets the size of the 6DOF sensor echo in physical meters. This is used
for the width of the gnomon and beam echoes. The default is 1
centimeter.
Parameters: echoSize - the size in meters |
setEchoTransformGroup | public void setEchoTransformGroup(TransformGroup echo)(Code) | | Sets the transform group containing a 6DOF sensor's echo geometry.
This is used to specify a custom echo. Its transform will be
manipulated to represent the position and orientation of the 6DOF
sensor. Capabilities to allow writing its transform and to read,
write, and extend its children will be set.
This method must be called before the behavior is made live in order to
have an effect.
Parameters: echo - the TransformGroup containing theecho geometry |
setEchoTransparency | public void setEchoTransparency(float transparency)(Code) | | Sets the 6DOF sensor echo transparency. The default is opaque. A
value of 0.0 is fully opaque and 1.0 is fully transparent. This can be
called to set the transparency before or after the echo geometry is
created.
Parameters: transparency - the transparency value |
setEchoType | public void setEchoType(int type)(Code) | | Sets the 6DOF sensor echo type. The default is GNOMON ,
which displays an object with points indicating the direction of each
of the sensor's coordinate axes at the location of the sensor's
hotspot. The alternative is BEAM , which displays a beam
from the sensor's origin to the location of the sensor's hotspot; the
hotspot must not be (0, 0, 0) or an
IllegalArgumentException will result. The width of each
of these echo types is specified by setEchoSize .
Parameters: type - GNOMON , BEAM , orNONE are recognized |
setEnable | public void setEnable(boolean enable)(Code) | | Enables or disables this behavior. The default state is enabled.
Parameters: enable - true or false to enable or disable this behavior |
setFastSpeedFactor | public void setFastSpeedFactor(double factor)(Code) | | Sets the fast translation speed factor. The default is 10 times the
normal speed.
Parameters: factor - scale by which the normal translation speed is multiplied |
setMatrixIndices2D | public void setMatrixIndices2D(int xIndex, int yIndex)(Code) | | Specifies where to find the X and Y values in the matrix read generated
by a 2D valuator. The defaults are along the translation components of
the matrix, at indices 3 and 7.
Parameters: xIndex - index of the X valuator value Parameters: yIndex - index of the Y valuator value |
setNominalSensorRotation | public void setNominalSensorRotation(Transform3D transform)(Code) | | Sets the nominal sensor transform. The default is the identity
transform.
This behavior assumes that when a hand-held wand is pointed directly at
a screen in an upright position, then its 6DOF sensor's local
coordinate system axes (its basis vectors) are nominally aligned with
the image plate basis vectors; specifically, that the sensor's -Z axis
points toward the screen, the +Y axis points up, and the +X axis points
to the right. The translation and rotation listeners provided by this
behavior assume this orientation to determine the transforms to be
applied to the view platform, in that translation applies along the
sensor Z axis, and rotation applies about axes defined in the sensor XY
plane.
This nominal alignment may not hold true depending upon how the sensor
is mounted and how the specific InputDevice supporting the
sensor handles its orientation. setNominalSensorRotation
can be called to correct the alignment by specifying the rotation
needed to transform vectors from the nominal sensor coordinate system,
aligned with the image plate coordinate system as described above, to
the sensor's actual local coordinate system.
NOTE: the nominal sensor transform applies only to the
translation directions and rotation axes created by the listeners
defined in this behavior; for compatibility with the core Java 3D API,
sensor reads and the sensor hotspot location are still expressed in the
sensor's local coordinate system.
Parameters: transform - Rotates vectors from the nominal sensor coordinatesystem system to the sensor's local coordinate system; only therotational components are used. May be set null foridentity. |
setReadAction2D | public void setReadAction2D(int action)(Code) | | Sets the action to be bound to 2D valuator reads. This action will be
performed on each frame whenever no button actions have been invoked
and the valuator read value is greater than the threshold range
specified by setThreshold2D .
The X and Y values from the valuator should have a continuous range
from -1.0 to +1.0, although speeds can be scaled to compensate for a
different range. The X and Y values are found in the sensor's read
matrix at the indices specified by the setMatrixIndices2D
method, with defaults of 3 and 7 respectively.
The default action of ROTATION rotates the view platform
in the direction the valuator is pushed. The rotation coordinate
system is set by setRotationCoords , with a default of
SENSOR . The rotation occurs about a point in the virtual
world set by setTransformCenterSource and
setTransformCenter , with the default set to rotate about
the hotspot of a 6DOF sensor, if one is available, or about the origin
of the virtual world if not. The rotation speed is scaled by the
valuator read value up to the maximum speed set with
setRotationSpeed ; the default is 180 degrees per second.
A value of TRANSLATION moves the view platform in the
direction the valuator is pushed. The translation occurs along the X
and Z basis vectors of either a 6DOF sensor or the view platform if a
6DOF sensor is not specified. The translation speed is scaled by the
valuator read value up to a maximum set by the product of the
setTranslationSpeed and setFastSpeedFactor
values.
If the value is to SCALE , then the view platform is scaled
smaller or larger when the valuator is pushed forward or backward. The
scaling occurs about a point in the virtual world set by
setTransformCenterSource and
setTransformCenter . The scaling speed is set with
setScaleSpeed , with a default scale factor of 2.0 per
second at the extreme negative range of -1.0, and a factor of 0.5 per
second at the extreme positive range of +1.0.
A value of NONE prevents ROTATION from being
bound by default to the 2D valuator reads.
This method only configures the read listeners pre-defined by
this behavior. For complete control over the read actions, access
the SensorEventAgent used by this behavior directly.
Parameters: action - either ROTATION , TRANSLATION ,SCALE , or NONE See Also: WandViewBehavior.setRotationCoords See Also: WandViewBehavior.setRotationSpeed See Also: WandViewBehavior.setTransformCenterSource See Also: WandViewBehavior.setTransformCenter See Also: WandViewBehavior.setTranslationSpeed See Also: WandViewBehavior.setFastSpeedFactor See Also: WandViewBehavior.setScaleSpeed See Also: WandViewBehavior.setMatrixIndices2D See Also: WandViewBehavior.getSensorEventAgent See Also: RotationListener2D See Also: TranslationListener2D See Also: ScaleListener2D |
setReadAction6D | public void setReadAction6D(int action)(Code) | | Sets the action to be bound to 6DOF sensor reads. This action will be
performed every frame whenever a button action has not been invoked.
The default is ECHO , which displays a geometric
representation of the sensor's current position and orientation in the
virtual world. A value of NONE indicates that no default
action is to be associated with the sensor's read.
This method only configures the read listeners pre-defined by
this behavior. For complete control over the read actions, access
the SensorEventAgent used by this behavior directly.
Parameters: action - either ECHO or NONE See Also: EchoReadListener6D See Also: WandViewBehavior.getSensorEventAgent |
setResetViewButtonCount2D | public void setResetViewButtonCount2D(int count)(Code) | | Sets the number of buttons to be pressed simultaneously on the 2D
valuator in order to reset the view back to the home transform. The
value must be greater than 1; the default is NONE . A
value of NONE disables this action.
Parameters: count - either NONE or button count > 1 See Also: ViewPlatformBehavior.setHomeTransform See Also: ViewPlatformBehavior.setHomeTransform |
setResetViewButtonCount6D | public void setResetViewButtonCount6D(int count)(Code) | | Sets the number of buttons to be pressed simultaneously
on the 6DOF sensor in order to reset the view back to the home
transform. The value must be greater than 1; the default is 3. A
value of NONE disables this action.
Parameters: count - either NONE or button count > 1 See Also: ViewPlatformBehavior.setHomeTransform See Also: ViewPlatformBehavior.setHomeTransform |
setRotationCoords | public void setRotationCoords(int coords)(Code) | | Sets the rotation coordinate system. The default is
SENSOR , which means that the rotation axis is parallel to
the XY plane of the current orientation of a specified 6DOF sensor. A
value of VIEW_PLATFORM means the rotation axis is parallel
to the XY plane of the view platform. The latter is also the fallback
if a 6DOF sensor is not specified. If the value is HEAD ,
then rotation occurs in head coordinates.
Parameters: coords - either SENSOR , VIEW_PLATFORM , orHEAD |
setRotationSpeed | public void setRotationSpeed(double speed, int units, int timeBase)(Code) | | Sets the rotation speed. The default is 180 degrees/second.
Parameters: speed - how fast to rotate Parameters: units - either DEGREES or RADIANS Parameters: timeBase - either PER_SECOND or PER_FRAME |
setScaleSpeed | public void setScaleSpeed(double speed, int timeBase)(Code) | | Sets the scaling speed. The default is 2.0 per second, which means
magnification doubles the apparent size of the virtual world every
second, and minification halves the apparent size of the virtual world
every second.
The scaling applied with each frame is Math.pow(scaleSpeed,
frameTime) , where frameTime is the time in seconds
that the last frame took to render if the time base is
PER_SECOND , or 1.0 if the time base is
PER_FRAME . If scaling is performed with the 2D valuator,
then the valuator's Y value as specified by
setMatrixIndices2D is an additional scale applied to the
exponent. If scaling is performed by the 6DOF sensor, then the scale
speed can be inverted with a negative exponent by using the appropriate
listener constructor flag.
Parameters: speed - specifies the scale speed Parameters: timeBase - either PER_SECOND or PER_FRAME |
setThreshold2D | public void setThreshold2D(double threshold)(Code) | | Sets the threshold for 2D valuator reads. The default is 0.0. It can
be set higher to handle noisy valuators.
Parameters: threshold - if the absolute values of both the X and Y valuatorreads are less than this value then the values are ignored |
setTransformCenter | public void setTransformCenter(Point3d center)(Code) | | Sets the center of rotation and scale if
setTransformCenterSource is called with
VWORLD_FIXED or if a 6DOF sensor is not specified. The
default is (0.0, 0.0, 0.0) in virtual world coordinates.
The transform center can be dynamically updated while the behavior is
running.
Parameters: center - point in virtual world coordinates about which to rotateand scale |
setTransformCenterSource | public void setTransformCenterSource(int source)(Code) | | Sets the source of the center of rotation and scale. The default is
HOTSPOT , which means the center of rotation or scale is a
6DOF sensor's current hotspot location. The alternative is
VWORLD_FIXED , which uses the fixed virtual world
coordinates specified by setTransformCenter as the center.
The latter is also the fallback if a 6DOF sensor is not specified.
The transform center source can be dynamically updated while the
behavior is running.
Parameters: source - either HOTSPOT or VWORLD_FIXED |
setTranslationSpeed | public void setTranslationSpeed(double speed, int units, int timeBase)(Code) | | Sets the normal translation speed. The default is 0.1 physical
meters/second.
Parameters: speed - how fast to translate Parameters: units - either PHYSICAL_METERS orVIRTUAL_UNITS Parameters: timeBase - either PER_SECOND orPER_FRAME |
setViewingPlatform | public void setViewingPlatform(ViewingPlatform vp)(Code) | | Sets the ViewingPlatform for this behavior. If a subclass
overrides this method, it must call
super.setViewingPlatform(vp) . NOTE: Applications should
not call this method. It is called by the
ViewingPlatform .
|
|
|