Class OGLCollidableShape
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.rigidphysics.BaseCollidableNode
org.web3d.vrml.renderer.common.nodes.rigidphysics.BaseCollidableShape
org.web3d.vrml.renderer.ogl.nodes.rigidphysics.OGLCollidableShape
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener
,VRMLNode
,FrameStateListener
,VRMLBoundedNodeType
,VRMLChildNodeType
,VRMLNBodyCollidableNodeType
,VRMLNodeType
,VRMLWorldRootChildNodeType
,OGLVRMLNode
public class OGLCollidableShape
extends BaseCollidableShape
implements OGLVRMLNode, org.j3d.aviatrix3d.NodeUpdateListener
Implementation of a CollidableShape.
- Version:
- $Revision: 1.3 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.rigidphysics.BaseCollidableShape
FIELD_SHAPE, LAST_SHAPE_INDEX, pShape, SHAPE_NODE_MSG, SHAPE_PROTO_MSG, vfShape
Fields inherited from class org.web3d.vrml.renderer.common.nodes.rigidphysics.BaseCollidableNode
FIELD_BBOX_CENTER, FIELD_BBOX_DISPLAY, FIELD_BBOX_SIZE, FIELD_ENABLED, FIELD_ROTATION, FIELD_TRANSLATION, FIELD_VISIBLE, LAST_COLLIDABLE_INDEX, odeGeom, tmatrix, vfBboxCenter, vfBboxDisplay, vfBboxSize, vfEnabled, vfRotation, vfTranslation, vfVisible
Fields 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
ConstructorsConstructorDescriptionInitialise the time dependent node and it's fields that are held locally.Construct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionvoid
The end of the frame has been reached, update the matrix now.org.j3d.aviatrix3d.SceneGraphObject
Get the OpenGL scene graph object representation of this node.protected void
setShape
(VRMLNodeType shape) Set node content as replacement for the shape field.void
Notification that the construction phase of this node has finished.void
ODE computation has finished, so go update the field values and the rendering API structures with the final computed values.void
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.void
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.Methods inherited from class org.web3d.vrml.renderer.common.nodes.rigidphysics.BaseCollidableShape
getFieldDeclaration, getFieldIndex, getFieldValue, getNodeFieldIndices, getNumFields, setValue
Methods inherited from class org.web3d.vrml.renderer.common.nodes.rigidphysics.BaseCollidableNode
copy, getBboxCenter, getBboxDisplay, getBboxSize, getODEGeometry, getPrimaryType, getRotation, getTranslation, getVisible, isEnabled, isShared, sendRoute, setBboxCenter, setBboxDisplay, setBboxSize, setEnabled, setRotation, setShared, setTranslation, setValue, setValue, setVisible, updateMatrix
Methods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getSecondaryType, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, throwInitOnlyWriteException, throwInputOnlyWriteException, throwInvalidNodeException, throwInvalidProtoException, throwOutputOnlyWriteException, updateRefCount, updateRefs
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
Methods 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, updateRefCount
-
Constructor Details
-
OGLCollidableShape
public OGLCollidableShape()Initialise the time dependent node and it's fields that are held locally. -
OGLCollidableShape
Construct a new instance of this node based on the details from the given node. If the node is not the same type, an exception will be thrown.- Parameters:
node
- The node to copy- Throws:
IllegalArgumentException
- The node is not the same type
-
-
Method Details
-
updateFromODE
public void updateFromODE()ODE computation has finished, so go update the field values and the rendering API structures with the final computed values.- Specified by:
updateFromODE
in interfaceVRMLNBodyCollidableNodeType
- Overrides:
updateFromODE
in classBaseCollidableNode
-
updateNodeBoundsChanges
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.- Specified by:
updateNodeBoundsChanges
in 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:
updateNodeDataChanges
in interfaceorg.j3d.aviatrix3d.NodeUpdateListener
- Parameters:
src
- The node or Node Component that is to be updated.
-
allEventsComplete
public void allEventsComplete()The end of the frame has been reached, update the matrix now.- Specified by:
allEventsComplete
in interfaceFrameStateListener
- Overrides:
allEventsComplete
in classBaseCollidableNode
-
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:
setupFinished
in interfaceVRMLNodeType
- Overrides:
setupFinished
in classBaseCollidableShape
-
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. Default implementation returns null.- Specified by:
getSceneGraphObject
in interfaceOGLVRMLNode
- Returns:
- The OpenGL representation.
-
setShape
Set node content as replacement for the shape field.- Overrides:
setShape
in classBaseCollidableShape
- Parameters:
shape
- The new Shape node to use- Throws:
InvalidFieldValueException
- The node does not match the required type.
-