Class Mouse6DPointerBehavior


public class Mouse6DPointerBehavior extends Behavior
This class provides basic behavior for a 6DOF mouse sensor. It generates a visible 3D cursor echo in the virtual world which tracks the position and orientation of the 6DOF mouse in the physical world. It can be extended to provide other functions by accessing its SensorEventAgent.
Since:
Java 3D 1.3
See Also:
  • Constructor Details

    • Mouse6DPointerBehavior

      public Mouse6DPointerBehavior(Sensor sensor, double size, boolean enableLighting)
      Constructs the behavior with a default echo. To make the echo visible, call getEcho() to retrieve the TransformGroup that parents the echo geometry, and then add that TransformGroup to the scene graph.

      The default echo is a solid 6-pointed star where each point is aligned with the axes of the local coordinate system of the sensor, and with the center of the star at the location of the sensor hotspot.

      Parameters:
      sensor - a 6 degree of freedom Sensor which generates position and orientation relative to the tracker base.
      size - the physical width of the echo in centimeters.
      enableLighting - a boolean indicating whether the echo geometry should have lighting enabled.
    • Mouse6DPointerBehavior

      public Mouse6DPointerBehavior(Sensor sensor, TransformGroup tg)
      Constructs the behavior with an echo parented by the specified TransformGroup.
      Parameters:
      sensor - a 6 degree of freedom Sensor which generates position and orientation relative to the tracker base.
      tg - a TransformGroup with a child defining the visible echo which will track the Sensor position and orientation; the Transform3D associated with the TransformGroup will be updated in order to effect the behavior, so it must have the ALLOW_TRANSFORM_WRITE capability set before the scene graph is set live
  • Method Details

    • getSensor

      public Sensor getSensor()
      Gets the sensor used by this behavior.
      Returns:
      the sensor used by this behavior
    • getEcho

      public TransformGroup getEcho()
      Gets the echo used by this behavior.
      Returns:
      the TransformGroup parenting this behavior's echo geometry
    • getSensorEventAgent

      public SensorEventAgent getSensorEventAgent()
      Gets the SensorEventAgent used by this behavior. This can be used to add customized event bindings to this behavior.
      Returns:
      the SensorEventAgent
    • initialize

      public void initialize()
      Initializes the behavior. NOTE: Applications should not call this method. It is called by the Java 3D behavior scheduler.
      Specified by:
      initialize in class Behavior
    • processStimulus

      public void processStimulus(Enumeration criteria)
      Processes a stimulus meant for this behavior. NOTE: Applications should not call this method. It is called by the Java 3D behavior scheduler.
      Specified by:
      processStimulus in class Behavior
      Parameters:
      criteria - an enumeration of triggered wakeup criteria for this behavior