Class OGLBillboard
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseGroupingNode
org.web3d.vrml.renderer.common.nodes.navigation.BaseBillboard
org.web3d.vrml.renderer.ogl.nodes.navigation.OGLBillboard
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener
,VRMLNode
,FrameStateListener
,VRMLBoundedNodeType
,VRMLChildNodeType
,VRMLExternalSynchronizedNodeType
,VRMLGroupingNodeType
,VRMLNodeType
,VRMLViewDependentNodeType
,VRMLWorldRootChildNodeType
,VisibilityListener
,OGLTransformNodeType
,OGLVisibilityListener
,OGLVRMLNode
public class OGLBillboard
extends BaseBillboard
implements OGLVRMLNode, VRMLExternalSynchronizedNodeType, OGLVisibilityListener, org.j3d.aviatrix3d.NodeUpdateListener, OGLTransformNodeType
OpenGL-renderer implementation of a Billboard node.
- Version:
- $Revision: 1.18 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.navigation.BaseBillboard
FIELD_AXISOFROTATION, FIELD_MAP, fieldDecl, LAST_BILLBOARD_INDEX, NUM_FIELDS, vfAxisOfRotation
Fields inherited from class org.web3d.vrml.renderer.common.nodes.BaseGroupingNode
childCount, FIELD_ADDCHILDREN, FIELD_BBOX_CENTER, FIELD_BBOX_DISPLAY, FIELD_BBOX_SIZE, FIELD_CHILDREN, FIELD_REMOVECHILDREN, FIELD_VISIBLE, hasBindables, LAST_GROUP_INDEX, shareCount, USE_BIND_MSG, vfBboxCenter, vfBboxDisplay, vfBboxSize, vfChildren, 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
ConstructorsConstructorDescriptionConstruct a default instance of this node.OGLBillboard
(VRMLNodeType node) Construct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addChildNode
(VRMLNodeType node) Add a single child node to the list of available children.void
Notification that the rendering of the event model is complete and that rendering is about to begin.protected void
Clear the child node list of all children - both VRML and OpenGL.org.j3d.aviatrix3d.SceneGraphObject
Get the OpenGL scene graph object representation of this node.int[]
Get the secondary type of this node.javax.vecmath.Matrix4f
Get the transform matrix for this node.void
notifyExternProtoLoaded
(int index, VRMLNodeType node) Notify a node that an ExternProto has resolved.void
Notification that event evaluation is about to start.void
Notification that event evaluation is about to start.protected void
removeChildNode
(VRMLNodeType node) Remove the given node from this grouping node.void
Notification that the construction phase of this node has finished.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.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.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.Methods inherited from class org.web3d.vrml.renderer.common.nodes.navigation.BaseBillboard
getFieldDeclaration, getFieldIndex, getFieldValue, getNodeFieldIndices, getNumFields, getPrimaryType, sendRoute, setValue
Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseGroupingNode
addChild, containsBindableNodes, copy, getBboxCenter, getBboxDisplay, getBboxSize, getChildren, getChildrenSize, getVisible, isShared, setBboxCenter, setBboxDisplay, setBboxSize, setChildren, setChildren, setDEF, setShared, setValue, setValue, setValue, setVisible, updateRefCount
Methods 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, removeNodeListener, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, throwInitOnlyWriteException, throwInputOnlyWriteException, throwInvalidNodeException, throwInvalidProtoException, throwOutputOnlyWriteException, 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, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
-
Constructor Details
-
OGLBillboard
public OGLBillboard()Construct a default instance of this node. The defaults are set by the VRML specification. -
OGLBillboard
Construct a new instance of this node based on the details from the given node. If the node is not a group node, an exception will be thrown.- Parameters:
node
- The node to copy- Throws:
IllegalArgumentException
- The node is not a Collision node
-
-
Method Details
-
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:
allEventsComplete
in interfaceFrameStateListener
- Overrides:
allEventsComplete
in classAbstractNode
-
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:
getSceneGraphObject
in interfaceOGLVRMLNode
- Returns:
- The OGL representation.
-
getSecondaryType
public int[] getSecondaryType()Get the secondary type of this node. Replaces the instanceof mechanism for use in switch statements.- Specified by:
getSecondaryType
in interfaceVRMLNode
- Overrides:
getSecondaryType
in classBaseBillboard
- Returns:
- The secondary type
-
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 classBaseGroupingNode
-
preEventEvaluation
public void preEventEvaluation()Notification that event evaluation is about to start. This is a safer time to modify the underlying rendering structures.- Specified by:
preEventEvaluation
in interfaceVRMLExternalSynchronizedNodeType
-
postEventEvaluation
public void postEventEvaluation()Notification that event evaluation is about to start. This is a safer time to modify the underlying rendering structures.- Specified by:
postEventEvaluation
in interfaceVRMLExternalSynchronizedNodeType
-
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:
visibilityStateChange
in 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.- Specified by:
viewPositionChanged
in 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
-
getTransform
public javax.vecmath.Matrix4f getTransform()Get the transform matrix for this node. A reference is ok as the users of this method will not modify the matrix.- Specified by:
getTransform
in interfaceOGLTransformNodeType
- Returns:
- The matrix.
-
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.
-
notifyExternProtoLoaded
Description copied from interface:VRMLNodeType
Notify a node that an ExternProto has resolved. This will verify the objects type and add it to the render sceneGraph.- Specified by:
notifyExternProtoLoaded
in interfaceVRMLNodeType
- Overrides:
notifyExternProtoLoaded
in classAbstractNode
- Parameters:
index
- The field indexnode
- The node resolved
-
clearChildren
protected void clearChildren()Clear the child node list of all children - both VRML and OpenGL.- Overrides:
clearChildren
in classBaseGroupingNode
-
addChildNode
Add a single child node to the list of available children. This auto matically deals with DEF/USE and adds links and branchgroups where appropriate. When nodes are null, we do not add them to the GL representation, only to the vfChildren list.- Overrides:
addChildNode
in classBaseGroupingNode
- Parameters:
node
- The node to view- Throws:
InvalidFieldValueException
- This is a bindable node shared
-
removeChildNode
Remove the given node from this grouping node. If the node is not a child of this node, the request is silently ignored.- Overrides:
removeChildNode
in classBaseGroupingNode
- Parameters:
node
- The node to remove- Throws:
InvalidFieldValueException
-