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, viewpointListeners
Fields inherited from class org.web3d.vrml.renderer.common.nodes.BaseBindableNode
FIELD_BIND, FIELD_BIND_TIME, FIELD_IS_BOUND, isOnStack, LAST_BINDABLE_INDEX, vfBindTime, vfIsBound
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
Fields 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_TELEPORT
Fields 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.TransformGroup
Get the parent transform used to control the view platform.org.j3d.aviatrix3d.SceneGraphObject
Get the OpenGL scene graph object representation of this node.javax.vecmath.Matrix4f
Get the transform matrix for this node.javax.vecmath.Matrix4f
Get the default Transform representation of this viewpoint based on its current position and orientation values.void
Notification that the origin has changed.void
setCenterOfRotation
(float[] pos) Set the center of rotation of this viewpoint.void
setNavigationTransform
(javax.vecmath.Matrix4f trans) Set a new transform for this viewpoint.protected void
setOrientation
(float[] dir) Convenience method to set the orientation of the viewpoint.protected void
setPosition
(double[] pos) Convenience method to set the position of the viewpoint.void
Notification that the construction phase of this node has finished.void
setWorldScale
(float scale) Set the world scale applied.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.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, setWorldLocation
Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseBindableNode
addBindableNodeListener, copy, fireIsBoundChanged, getBindTime, getIsBound, removeBindableNodeListener, setBind, setOnStack, setVRMLClock
Methods 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, 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.nodes.FrameStateListener
allEventsComplete
Methods inherited from interface org.web3d.vrml.renderer.ogl.nodes.OGLBindableNodeType
setOnStack
Methods inherited from interface org.web3d.vrml.nodes.VRMLBindableNodeType
addBindableNodeListener, getBindTime, getIsBound, removeBindableNodeListener, setBind
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
Methods 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:
getSceneGraphObject
in interfaceOGLVRMLNode
- Returns:
- The OpenGL representation.
-
setPosition
protected void setPosition(double[] pos) Convenience method to set the position of the viewpoint.- Overrides:
setPosition
in classBaseGeoViewpoint
- Parameters:
pos
- The position vector to use
-
setOrientation
protected void setOrientation(float[] dir) Convenience method to set the orientation of the viewpoint.- Overrides:
setOrientation
in 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:
setCenterOfRotation
in interfaceVRMLViewpointNodeType
- Overrides:
setCenterOfRotation
in 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:
setupFinished
in interfaceVRMLNodeType
- Overrides:
setupFinished
in classBaseGeoViewpoint
-
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.
-
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.
-
originChanged
public void originChanged()Notification that the origin has changed.- Specified by:
originChanged
in 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:
getViewTransform
in 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:
getPlatformGroup
in 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:
setWorldScale
in interfaceOGLViewpointNodeType
- Parameters:
scale
- The new world scale.
-