Class OGLVisibilitySensor
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseSensorNode
org.web3d.vrml.renderer.common.nodes.environment.BaseVisibilitySensor
org.web3d.vrml.renderer.ogl.nodes.environment.OGLVisibilitySensor
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener,VRMLNode,FrameStateListener,VRMLChildNodeType,VRMLEnvironmentalSensorNodeType,VRMLNodeType,VRMLSensorNodeType,VRMLTimeDependentNodeType,VRMLWorldRootChildNodeType,VisibilityListener,OGLVisibilityListener,OGLVRMLNode
public class OGLVisibilitySensor
extends BaseVisibilitySensor
implements OGLVRMLNode, OGLVisibilityListener, org.j3d.aviatrix3d.NodeUpdateListener
OpenGL implementation of a VisibilitySensor node.
- Version:
- $Revision: 1.6 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.environment.BaseVisibilitySensor
FIELD_CENTER, FIELD_ENTER_TIME, FIELD_EXIT_TIME, FIELD_SIZE, LAST_VISIBILITYSENSOR_INDEX, vfCenter, vfEnterTime, vfExitTime, vfSize, vrmlClockFields inherited from class org.web3d.vrml.renderer.common.nodes.BaseSensorNode
FIELD_ENABLED, FIELD_IS_ACTIVE, 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 visibility 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.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.voidviewPositionChanged(javax.vecmath.Point3f position, javax.vecmath.AxisAngle4f orientation, javax.vecmath.Matrix4f localPosition) Notification that the object is still visible, but that the viewer reference point has changed.voidvisibilityStateChange(boolean visible, javax.vecmath.Point3f position, javax.vecmath.AxisAngle4f orientation, javax.vecmath.Matrix4f localPosition) Invoked when the user enters or leaves an area.Methods inherited from class org.web3d.vrml.renderer.common.nodes.environment.BaseVisibilitySensor
getFieldDeclaration, getFieldIndex, getFieldValue, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, sendRoute, setValueMethods inherited from class org.web3d.vrml.renderer.common.nodes.BaseSensorNode
copy, getEnabled, getIsActive, setValueMethods 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
-
OGLVisibilitySensor
public OGLVisibilitySensor()Construct a new visibility sensor object -
OGLVisibilitySensor
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
-
visibilityStateChange
public void visibilityStateChange(boolean visible, javax.vecmath.Point3f position, javax.vecmath.AxisAngle4f orientation, javax.vecmath.Matrix4f localPosition) Invoked when the user enters or leaves an area.- Specified by:
visibilityStateChangein interfaceOGLVisibilityListener- Parameters:
visible- true when the user enters the areaposition- The position of the user on entry/exitorientation- The orientation of the user therelocalPosition- The vworld transform object for the class that implemented this listener
-
viewPositionChanged
public void viewPositionChanged(javax.vecmath.Point3f position, javax.vecmath.AxisAngle4f orientation, javax.vecmath.Matrix4f localPosition) Notification that the object is still visible, but that the viewer reference point has changed. Ignored for this implementation.- Specified by:
viewPositionChangedin interfaceOGLVisibilityListener- Parameters:
position- The new position of the userorientation- The orientation of the user therelocalPosition- The vworld transform object for the class that implemented this listener
-
setVRMLClock
Set the vrmlClock that this time dependent node will be running with.- Specified by:
setVRMLClockin interfaceVRMLTimeDependentNodeType- Overrides:
setVRMLClockin classBaseVisibilitySensor- 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 classBaseVisibilitySensor- 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 classBaseVisibilitySensor- 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.
-