Class WandViewBehavior.TranslationListener2D

All Implemented Interfaces:
SensorButtonListener, SensorReadListener
Enclosing class:
WandViewBehavior

public class WandViewBehavior.TranslationListener2D extends WandViewBehavior.ListenerBase
Implements a 2D valuator listener that translates the view platform. The X and Y values from the valuator should have a continuous range from -1.0 to +1.0, although the translation speed 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 setMatrixIndices2D, with defaults of 3 and 7 respectively.

The translation direction is controlled by the direction the 2D valuator is pushed, and the speed is the translation speed scaled by the fast speed factor and the magnitude of the 2D valuator reads.

This listener will work in conjunction with a 6DOF sensor if supplied in the constructor. If a 6DOF sensor is provided then the translation occurs along the basis vectors of the 6DOF sensor's coordinate system; otherwise, the translation occurs along the view platform's basis vectors.

See Also:
  • Constructor Details

    • TranslationListener2D

      public TranslationListener2D(Sensor sensor2D, Sensor sensor6D)
      Construct an instance of this class using the specified sensors.
      Parameters:
      sensor2D - 2D valuator sensor for translation
      sensor6D - 6DOF sensor for translation direction; may be null
  • Method Details