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 TypeMethodDescriptionintaddObjectType(String type) Add a new flag to the system and get told what bitmask to use.voidaddSensor(VRMLPickingSensorNodeType sensor) Add a new sensor instance to the system for processing.voidclear()Force clearing all state from this manager now.voidloadScene(BasicScene scene) Load the contents of this scene into the sensor manager.voidprocessPickSensors(double time) Process the list of picking sensors now.voidremoveObjectType(String type) Notify the system that the flag is no longer being used by this node.voidCleanup the given sensors and remove them from the list of processing to be done each frame.voidsetErrorReporter(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.voidunloadScene(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:
setErrorReporterin interfacePickingManager- Parameters:
reporter- The instance to use or null
-
processPickSensors
public void processPickSensors(double time) Process the list of picking sensors now.- Specified by:
processPickSensorsin interfacePickingManager- Parameters:
time- The timestamp for "now"
-
addSensor
Add a new sensor instance to the system for processing.- Specified by:
addSensorin 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:
removeSensorin 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:
loadScenein 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:
unloadScenein 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:
clearin interfacePickingManager
-
addObjectType
Add a new flag to the system and get told what bitmask to use.- Specified by:
addObjectTypein 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:
removeObjectTypein interfaceOGLPickingFlagConvertor- Parameters:
type- The type string to use
-