Class OGLGeoViewpoint
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseBindableNode
org.web3d.vrml.renderer.common.nodes.geospatial.BaseGeoViewpoint
org.web3d.vrml.renderer.ogl.nodes.geospatial.OGLGeoViewpoint
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener,VRMLNode,FrameStateListener,VRMLBindableNodeType,VRMLChildNodeType,VRMLNavigationInfoNodeType,VRMLNodeType,VRMLTimeDependentNodeType,VRMLViewpointNodeType,VRMLWorldRootChildNodeType,OGLBindableNodeType,OGLTransformNodeType,OGLViewpointNodeType,OGLVRMLNode,OriginListener
public class OGLGeoViewpoint
extends BaseGeoViewpoint
implements OGLViewpointNodeType, org.j3d.aviatrix3d.NodeUpdateListener, OGLTransformNodeType, OriginListener
OpenGL implementation of an GeoViewpoint
- Version:
- $Revision: 1.12 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.geospatial.BaseGeoViewpoint
axis, centerOfRotation, changeListener, FIELD_CENTER_OF_ROTATION, FIELD_DESCRIPTION, FIELD_FARDISTANCE, FIELD_FIELDOFVIEW, FIELD_GEO_ORIGIN, FIELD_GEO_SYSTEM, FIELD_HEADLIGHT, FIELD_JUMP, FIELD_NAV_TYPE, FIELD_NEARDISTANCE, FIELD_ORIENTATION, FIELD_POSITION, FIELD_RETAIN_USER_OFFSETS, FIELD_SET_ORIENTATION, FIELD_SET_POSITION, FIELD_SPEED_FACTOR, FIELD_VIEWALL, LAST_VIEWPOINT_INDEX, local_origin, localPosition, NUM_FIELDS, originManager, pGeoOrigin, useOriginManager, vfDescription, vfFarDistance, vfFieldOfView, vfGeoOrigin, vfGeoSystem, vfHeadlight, vfJump, vfNavType, vfNearDistance, vfOrientation, vfPosition, vfRetainUserOffsets, vfSpeedFactor, 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.VRMLNavigationInfoNodeType
NAV_TYPE_ANY, NAV_TYPE_EXAMINE, NAV_TYPE_FLY, NAV_TYPE_LOOKAT, NAV_TYPE_NONE, NAV_TYPE_WALK, TRANSITION_TYPE_ANIMATE, TRANSITION_TYPE_LINEAR, TRANSITION_TYPE_TELEPORTFields inherited from interface org.web3d.vrml.nodes.VRMLViewpointNodeType
PROJECTION_ORTHO, PROJECTION_PERSPECTIVE -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a default geoviewpoint instanceOGLGeoViewpoint(VRMLNodeType node) Construct 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.voidNotification that the origin has changed.voidsetCenterOfRotation(float[] pos) Set the center of rotation of this viewpoint.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(double[] 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.geospatial.BaseGeoViewpoint
addNavigationChangedListener, addViewpointListener, convOriToAxisAngle, fireCenterOfRotationChanged, fireFieldOfViewChanged, getAvatarSize, getCenterOfRotation, getDescription, getFarDistance, getFieldDeclaration, getFieldIndex, getFieldOfView, getFieldValue, getHeadlight, getJump, getNearDistance, getNodeFieldIndices, getNumFields, getNumTypes, getPrimaryType, getProjectionType, getRetainUserOffsets, getSecondaryType, getSpeed, getType, getViewAll, getVisibilityLimit, removeNavigationChangedListener, removeViewpointListener, sendRoute, setAvatarSize, setDescription, setFarDistance, setFieldOfView, setHeadlight, setJump, setNearDistance, setRetainUserOffsets, setSpeed, setType, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setViewAll, setVisibilityLimit, setWorldLocationMethods inherited from class org.web3d.vrml.renderer.common.nodes.BaseBindableNode
addBindableNodeListener, copy, fireIsBoundChanged, getBindTime, getIsBound, 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, 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, setDescription, setJump, setRetainUserOffsets, setViewAll
-
Constructor Details
-
OGLGeoViewpoint
public OGLGeoViewpoint()Construct a default geoviewpoint instance -
OGLGeoViewpoint
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- Incorrect Node 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(double[] pos) Convenience method to set the position of the viewpoint.- Overrides:
setPositionin classBaseGeoViewpoint- Parameters:
pos- The position vector to use
-
setOrientation
protected void setOrientation(float[] dir) Convenience method to set the orientation of the viewpoint.- Overrides:
setOrientationin classBaseGeoViewpoint- Parameters:
dir- The orientation quaternion to use
-
setCenterOfRotation
Set the center of rotation of this viewpoint. The center is a position in 3-space.- Specified by:
setCenterOfRotationin interfaceVRMLViewpointNodeType- Overrides:
setCenterOfRotationin classBaseGeoViewpoint- Parameters:
pos- The new position to use- Throws:
InvalidFieldValueException- The field used is not 3 values
-
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 classBaseGeoViewpoint
-
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.
-
originChanged
public void originChanged()Notification that the origin has changed.- Specified by:
originChangedin interfaceOriginListener
-
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.
-