Class OGLOrthoViewpoint
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseBindableNode
org.web3d.vrml.renderer.common.nodes.navigation.BaseOrthoViewpoint
org.web3d.vrml.renderer.ogl.nodes.navigation.OGLOrthoViewpoint
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener,VRMLNode,FrameStateListener,VRMLBindableNodeType,VRMLChildNodeType,VRMLNodeType,VRMLTimeDependentNodeType,VRMLViewpointNodeType,VRMLWorldRootChildNodeType,OGLBindableNodeType,OGLTransformNodeType,OGLViewpointNodeType,OGLVRMLNode
public class OGLOrthoViewpoint
extends BaseOrthoViewpoint
implements OGLViewpointNodeType, org.j3d.aviatrix3d.NodeUpdateListener, OGLTransformNodeType
OGL implementation of a Viewpoint node.
Viewpoints cannot be shared using DEF/USE. They may be named as such for Anchor purposes, but attempting to reuse them will cause an error. This implementation does not provide any protection against USE of this node and attempting to do so will result in exceptions - most probably in the grouping node that includes this node.
- Version:
- $Revision: 1.3 $
- Author:
- Alan Hudson
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.navigation.BaseOrthoViewpoint
FIELD_CENTEROFROTATION, FIELD_DESCRIPTION, FIELD_FARDISTANCE, FIELD_FIELDOFVIEW, FIELD_JUMP, FIELD_NEARDISTANCE, FIELD_ORIENTATION, FIELD_POSITION, FIELD_RETAIN_USER_OFFSETS, FIELD_VIEWALL, LAST_VIEWPOINT_INDEX, NUM_FIELDS, vfCenterOfRotation, vfDescription, vfFarDistance, vfFieldOfView, vfJump, vfNearDistance, vfOrientation, vfPosition, vfRetainUserOffsets, vfViewAll, viewpointListenersFields inherited from class org.web3d.vrml.renderer.common.nodes.BaseBindableNode
FIELD_BIND, FIELD_BIND_TIME, FIELD_IS_BOUND, isOnStack, LAST_BINDABLE_INDEX, vfBindTime, vfIsBoundFields 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, vrmlMinorVersionFields inherited from interface org.web3d.vrml.nodes.VRMLViewpointNodeType
PROJECTION_ORTHO, PROJECTION_PERSPECTIVE -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a default viewpoint instanceConstruct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionorg.j3d.aviatrix3d.TransformGroupGet the parent transform used to control the view platform.org.j3d.aviatrix3d.SceneGraphObjectGet the OpenGL scene graph object representation of this node.javax.vecmath.Matrix4fGet the transform matrix for this node.javax.vecmath.Matrix4fGet the default Transform representation of this viewpoint based on its current position and orientation values.voidsetNavigationTransform(javax.vecmath.Matrix4f trans) Set a new transform for this viewpoint.protected voidsetOrientation(float[] dir) Convenience method to set the orientation of the viewpoint.protected voidsetPosition(float[] pos) Convenience method to set the position of the viewpoint.voidNotification that the construction phase of this node has finished.voidsetWorldScale(float scale) Set the world scale applied.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.Methods inherited from class org.web3d.vrml.renderer.common.nodes.navigation.BaseOrthoViewpoint
addViewpointListener, fireCenterOfRotationChanged, fireFieldOfViewChanged, getCenterOfRotation, getDescription, getFarDistance, getFieldDeclaration, getFieldIndex, getFieldOfView, getFieldValue, getJump, getNearDistance, getNodeFieldIndices, getNumFields, getPrimaryType, getProjectionType, getRetainUserOffsets, getViewAll, removeViewpointListener, sendRoute, setCenterOfRotation, setDescription, setFarDistance, setFieldOfView, setJump, setNearDistance, setRetainUserOffsets, setValue, setValue, setValue, setValue, setViewAllMethods inherited from class org.web3d.vrml.renderer.common.nodes.BaseBindableNode
addBindableNodeListener, copy, fireIsBoundChanged, getBindTime, getIsBound, getSecondaryType, removeBindableNodeListener, setBind, setOnStack, setVRMLClockMethods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, allEventsComplete, 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, 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.nodes.FrameStateListener
allEventsCompleteMethods inherited from interface org.web3d.vrml.renderer.ogl.nodes.OGLBindableNodeType
setOnStackMethods inherited from interface org.web3d.vrml.nodes.VRMLBindableNodeType
addBindableNodeListener, getBindTime, getIsBound, removeBindableNodeListener, setBindMethods 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.VRMLViewpointNodeType
addViewpointListener, getCenterOfRotation, getDescription, getFieldOfView, getJump, getProjectionType, getRetainUserOffsets, getViewAll, removeViewpointListener, setCenterOfRotation, setDescription, setJump, setRetainUserOffsets, setViewAll
-
Constructor Details
-
OGLOrthoViewpoint
public OGLOrthoViewpoint()Construct a default viewpoint instance -
OGLOrthoViewpoint
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
-
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:
getSceneGraphObjectin interfaceOGLVRMLNode- Returns:
- The OpenGL representation.
-
setPosition
protected void setPosition(float[] pos) Convenience method to set the position of the viewpoint.- Overrides:
setPositionin classBaseOrthoViewpoint- Parameters:
pos- The position vector to use
-
setOrientation
protected void setOrientation(float[] dir) Convenience method to set the orientation of the viewpoint.- Overrides:
setOrientationin classBaseOrthoViewpoint- Parameters:
dir- The orientation quaternion to use
-
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
-
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.
-
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:
getTransformin interfaceOGLTransformNodeType- Returns:
- The matrix.
-
getViewTransform
public javax.vecmath.Matrix4f getViewTransform()Get the default Transform representation of this viewpoint based on its current position and orientation values. This is used to reset the viewpoint to the original position after the user has moved around or we transition between two viewpoints. It should remain independent of the underlying TransformGroup.- Specified by:
getViewTransformin interfaceOGLViewpointNodeType- Returns:
- The default transform of this viewpoint
-
getPlatformGroup
public org.j3d.aviatrix3d.TransformGroup getPlatformGroup()Get the parent transform used to control the view platform. Used for the navigation controls.- Specified by:
getPlatformGroupin interfaceOGLViewpointNodeType- Returns:
- The current view TransformGroup
-
setWorldScale
public void setWorldScale(float scale) Set the world scale applied. This will scale down navinfo parameters to fit into the world.- Specified by:
setWorldScalein interfaceOGLViewpointNodeType- Parameters:
scale- The new world scale.
-