Package org.xj3d.core.eventmodel
Class InputDeviceManager
java.lang.Object
org.xj3d.core.eventmodel.InputDeviceManager
Sits between input devices and the UserInputHandler.
Determines which one has control of navigation and picking.
Maintains picking state.
KeySensor handling is performed separately by the KeyDeviceSensorManager
Each sensor will have a current active touch, drag and anchor sensor. It cannot activate another till that's cleared.
- Version:
- $Revision: 1.8 $
- Author:
- Alan Hudson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a new X3DDeviceSensorNode.void
Notification that tracker processing is starting for a frame.void
clear()
Clear all of the currently registered nodes.void
Notification that tracker processing is ending for a frame.void
Initialize the device manager.void
processTrackers
(int layerId, boolean navigate, UserInputHandler uiHandler, boolean pickable) Processes input from sensors and issues commands to the UserInputHandler.void
reinitialize
(DeviceFactory factory) Set a new device factory to use.void
Remove a X3DDeviceSensorNode.void
setErrorReporter
(org.j3d.util.ErrorReporter reporter) Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion.
-
Constructor Details
-
InputDeviceManager
Create a new device manager.- Parameters:
factory
- The DeviceFactory that provides access to the devices and the UI event system.
-
-
Method Details
-
reinitialize
Set a new device factory to use. Reinitialize devices.- Parameters:
factory
- The new DeviceFactory
-
setErrorReporter
public void setErrorReporter(org.j3d.util.ErrorReporter reporter) Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.- Parameters:
reporter
- The instance to use or null
-
initialize
public void initialize()Initialize the device manager. Called after all devices are registered. Handled by the SensorManager. -
addX3DNode
Add a new X3DDeviceSensorNode.- Parameters:
node
- The new sensor
-
removeX3DNode
Remove a X3DDeviceSensorNode.- Parameters:
node
- The sensor
-
clear
public void clear()Clear all of the currently registered nodes. Used in preparation for loading a new scene. -
beginTrackerProcessing
public void beginTrackerProcessing()Notification that tracker processing is starting for a frame. -
endTrackerProcessing
public void endTrackerProcessing()Notification that tracker processing is ending for a frame. -
processTrackers
public void processTrackers(int layerId, boolean navigate, UserInputHandler uiHandler, boolean pickable) Processes input from sensors and issues commands to the UserInputHandler. Called by the event model at the appropriate time. Do not call from elsewhere.- Parameters:
layerId
- The layer that we're reading fromnavigate
- Should navigation be processeduiHandler
- The uiHandler for this layerpickable
- Is the layer pickable
-