Class DefaultPickingManager
java.lang.Object
org.web3d.vrml.renderer.ogl.input.DefaultPickingManager
- All Implemented Interfaces:
OGLPickingFlagConvertor
,PickingManager
public class DefaultPickingManager
extends Object
implements PickingManager, OGLPickingFlagConvertor
Manager for processing the functionality of the Picking Utilities component.
Picking and, ultimately, n-body object collision detection is handled by this manager.
- Version:
- $Revision: 1.9 $
- Author:
- Justin Couch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
addObjectType
(String type) Add a new flag to the system and get told what bitmask to use.void
addSensor
(VRMLPickingSensorNodeType sensor) Add a new sensor instance to the system for processing.void
clear()
Force clearing all state from this manager now.void
loadScene
(BasicScene scene) Load the contents of this scene into the sensor manager.void
processPickSensors
(double time) Process the list of picking sensors now.void
removeObjectType
(String type) Notify the system that the flag is no longer being used by this node.void
Cleanup the given sensors and remove them from the list of processing to be done each frame.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.void
unloadScene
(BasicScene scene) Unload the contents of this scene into the sensor manager.
-
Constructor Details
-
DefaultPickingManager
public DefaultPickingManager()Construct a new instance of this class.
-
-
Method Details
-
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.- Specified by:
setErrorReporter
in interfacePickingManager
- Parameters:
reporter
- The instance to use or null
-
processPickSensors
public void processPickSensors(double time) Process the list of picking sensors now.- Specified by:
processPickSensors
in interfacePickingManager
- Parameters:
time
- The timestamp for "now"
-
addSensor
Add a new sensor instance to the system for processing.- Specified by:
addSensor
in interfacePickingManager
- Parameters:
sensor
- The sensor instance to add
-
removeSensor
Cleanup the given sensors and remove them from the list of processing to be done each frame. The list will be created elsewhere (typically the per-frame behaviour as a result of the event model processing) and passed to this manager. The given list will contain instances of VRMLSensorNodeType. There will be no protos as this is just the raw sensor nodes internally.- Specified by:
removeSensor
in interfacePickingManager
- Parameters:
sensor
- The sensor instance to remove
-
loadScene
Load the contents of this scene into the sensor manager. The call does not need to be recursive as it is expected the external caller will work with this.- Specified by:
loadScene
in interfacePickingManager
- Parameters:
scene
- The scene to source data from
-
unloadScene
Unload the contents of this scene into the sensor manager. The call does not need to be recursive as it is expected the external caller will work with this.- Specified by:
unloadScene
in interfacePickingManager
- Parameters:
scene
- The scene to source data from
-
clear
public void clear()Force clearing all state from this manager now. This is used to indicate that a new world is about to be loaded and everything should be cleaned out now.- Specified by:
clear
in interfacePickingManager
-
addObjectType
Add a new flag to the system and get told what bitmask to use.- Specified by:
addObjectType
in interfaceOGLPickingFlagConvertor
- Parameters:
type
- The type string to use- Returns:
- An int bit mask to be applied
-
removeObjectType
Notify the system that the flag is no longer being used by this node.- Specified by:
removeObjectType
in interfaceOGLPickingFlagConvertor
- Parameters:
type
- The type string to use
-