Class OGLProximitySensor
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseSensorNode
org.web3d.vrml.renderer.common.nodes.environment.BaseProximitySensor
org.web3d.vrml.renderer.ogl.nodes.environment.OGLProximitySensor
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener,VRMLNode,FrameStateListener,VRMLChildNodeType,VRMLEnvironmentalSensorNodeType,VRMLNodeType,VRMLSensorNodeType,VRMLTimeDependentNodeType,VRMLWorldRootChildNodeType,AreaListener,OGLAreaListener,OGLVRMLNode
public class OGLProximitySensor
extends BaseProximitySensor
implements OGLVRMLNode, OGLAreaListener, org.j3d.aviatrix3d.NodeUpdateListener
OpenGL implementation of a ProximitySensor node.
- Version:
- $Revision: 1.7 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.environment.BaseProximitySensor
FIELD_CENTER, FIELD_CENTEROFROTATION_CHANGED, FIELD_ENABLED, FIELD_ENTER_TIME, FIELD_EXIT_TIME, FIELD_IS_ACTIVE, FIELD_ORIENTATION_CHANGED, FIELD_POSITION_CHANGED, FIELD_SIZE, LAST_PROXIMITYSENSOR_INDEX, vfCenter, vfCenterOfRotationChanged, vfEnterTime, vfExitTime, vfOrientationChanged, vfPositionChanged, vfSize, vrmlClockFields inherited from class org.web3d.vrml.renderer.common.nodes.BaseSensorNode
LAST_SENSOR_INDEX, vfEnabled, vfIsActiveFields inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
errorReporter, FIELD_METADATA, fieldLocalData, hasChanged, inSetup, isDEF, isStatic, LAST_NODE_INDEX, layerIds, nodeName, pMetadata, refCounts, removedLayerIds, stateManager, STATIC_SCENE_GRAPH, vfMetadata, vrmlMajorVersion, vrmlMinorVersion -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new proximity sensor objectConstruct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionvoidNotification that the rendering of the event model is complete and that rendering is about to begin.voidareaEntry(javax.vecmath.Point3f position, javax.vecmath.Vector3f orientation, javax.vecmath.Matrix4f vpMatrix, javax.vecmath.Matrix4f localPosition) Invoked when the user enters an area.voidareaExit()Invoked when the tracked object exits on area.org.j3d.aviatrix3d.SceneGraphObjectGet the OpenGL scene graph object representation of this node.protected voidsetCenter(float[] val) Update the center of the sensor.voidsetEnabled(boolean state) Set the sensor enabled or disabled.protected voidsetSize(float[] val) Update the size of the sensor.voidNotification that the construction phase of this node has finished.voidsetVRMLClock(VRMLClock clk) Set the vrmlClock that this time dependent node will be running with.voidNotification that its safe to update the node now with any operations that could potentially effect the node's bounds.voidNotification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.voiduserPositionChanged(javax.vecmath.Point3f position, javax.vecmath.Vector3f orientation, javax.vecmath.Matrix4f vpMatrix, javax.vecmath.Matrix4f localPosition) Notification that the user is still in the area, but that the viewer reference point has changed.Methods inherited from class org.web3d.vrml.renderer.common.nodes.environment.BaseProximitySensor
getFieldDeclaration, getFieldIndex, getFieldValue, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, sendRoute, setValue, setValueMethods inherited from class org.web3d.vrml.renderer.common.nodes.BaseSensorNode
copy, getEnabled, getIsActiveMethods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, throwInitOnlyWriteException, throwInputOnlyWriteException, throwInvalidNodeException, throwInvalidProtoException, throwOutputOnlyWriteException, updateRefCount, updateRefsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersionMethods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCountMethods inherited from interface org.web3d.vrml.nodes.VRMLSensorNodeType
getEnabled, getIsActive
-
Constructor Details
-
OGLProximitySensor
public OGLProximitySensor()Construct a new proximity sensor object -
OGLProximitySensor
Construct a new instance of this node based on the details from the given node. If the node is not the right type, an exception will be thrown.- Parameters:
node- The node to copy- Throws:
IllegalArgumentException- The node is not the right type
-
-
Method Details
-
setEnabled
public void setEnabled(boolean state) Set the sensor enabled or disabled.- Specified by:
setEnabledin interfaceVRMLSensorNodeType- Overrides:
setEnabledin classBaseSensorNode- Parameters:
state- true if the sensor is to be enabled
-
getSceneGraphObject
public org.j3d.aviatrix3d.SceneGraphObject getSceneGraphObject()Get the OpenGL scene graph object representation of this node. This will need to be cast to the appropriate parent type when being used.- Specified by:
getSceneGraphObjectin interfaceOGLVRMLNode- Returns:
- The OGL representation.
-
setupFinished
public void setupFinished()Notification that the construction phase of this node has finished. If the node would like to do any internal processing, such as setting up geometry, then go for it now.- Specified by:
setupFinishedin interfaceVRMLNodeType- Overrides:
setupFinishedin classAbstractNode
-
areaEntry
public void areaEntry(javax.vecmath.Point3f position, javax.vecmath.Vector3f orientation, javax.vecmath.Matrix4f vpMatrix, javax.vecmath.Matrix4f localPosition) Invoked when the user enters an area.- Specified by:
areaEntryin interfaceOGLAreaListener- Parameters:
position- The new position of the userorientation- The orientation of the user therevpMatrix-localPosition- The vworld transform object for the class that implemented this listener
-
userPositionChanged
public void userPositionChanged(javax.vecmath.Point3f position, javax.vecmath.Vector3f orientation, javax.vecmath.Matrix4f vpMatrix, javax.vecmath.Matrix4f localPosition) Notification that the user is still in the area, but that the viewer reference point has changed.- Specified by:
userPositionChangedin interfaceOGLAreaListener- Parameters:
position- The new position of the userorientation- The orientation of the user therevpMatrix-localPosition- The vworld transform object for the class that implemented this listener
-
areaExit
public void areaExit()Invoked when the tracked object exits on area.- Specified by:
areaExitin interfaceOGLAreaListener
-
setVRMLClock
Set the vrmlClock that this time dependent node will be running with.- Specified by:
setVRMLClockin interfaceVRMLTimeDependentNodeType- Overrides:
setVRMLClockin classBaseProximitySensor- Parameters:
clk- The vrmlClock to use for this node
-
setSize
protected void setSize(float[] val) Update the size of the sensor. May be overridden by derived classes but should make sure to call this as well- Overrides:
setSizein classBaseProximitySensor- Parameters:
val- The new size to use
-
setCenter
protected void setCenter(float[] val) Update the center of the sensor. May be overridden by derived classes but should make sure to call this as well- Overrides:
setCenterin classBaseProximitySensor- Parameters:
val- The new center to use
-
allEventsComplete
public void allEventsComplete()Notification that the rendering of the event model is complete and that rendering is about to begin. Used to update the transformation matrix only once per frame.- Specified by:
allEventsCompletein interfaceFrameStateListener- Overrides:
allEventsCompletein classAbstractNode
-
updateNodeBoundsChanges
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.- Specified by:
updateNodeBoundsChangesin interfaceorg.j3d.aviatrix3d.NodeUpdateListener- Parameters:
src- The node or Node Component that is to be updated.
-
updateNodeDataChanges
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.- Specified by:
updateNodeDataChangesin interfaceorg.j3d.aviatrix3d.NodeUpdateListener- Parameters:
src- The node or Node Component that is to be updated.
-