Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLViewpointNodeType

All Superinterfaces:
FrameStateListener, VRMLBindableNodeType, VRMLChildNodeType, VRMLNode, VRMLNodeType, VRMLWorldRootChildNodeType
All Known Subinterfaces:
OGLViewpointNodeType

public interface VRMLViewpointNodeType
extends VRMLBindableNodeType

Base representation of a viewpoint node in the scene.

A viewpoint provides a place to examine the contents of the virtual world. Depending on the world type, the way of specifying a viewpoint's location and orientation may change. This base interface describes all of the common requirements for a viewpoint.

Version:
$Revision: 1.10 $
Author:
Alan Hudson, Justin Couch

Field Summary
static int PROJECTION_ORTHO
           
static int PROJECTION_PERSPECTIVE
           
 
Method Summary
 void addViewpointListener(ViewpointListener l)
          Add a ViewpointListener.
 float[] getCenterOfRotation()
          Get the center of rotation defined by this viewpoint.
 java.lang.String getDescription()
          Get the description string associated with this viewpoint.
 float[] getFieldOfView()
          Get the field of view used by this viewpoint.
 boolean getJump()
          Get the Jump field value of this viewpoint.
 int getProjectionType()
          Get the projection type.
 boolean getRetainUserOffsets()
          Get the retainUserOffsets field value of this viewpoint.
 void removeViewpointListener(ViewpointListener l)
          Remove a ViewpointListener.
 void setCenterOfRotation(float[] pos)
          Set the center of rotation of this viewpoint.
 void setDescription(java.lang.String desc)
          Set the description string of this viewpoint.
 void setJump(boolean jump)
          Set the jump field value of this viewpoint to the new value
 void setRetainUserOffsets(boolean retainUserOffsets)
          Set the retainUserOffsets field value of this viewpoint to the new value
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLBindableNodeType
addBindableNodeListener, getBindTime, getIsBound, removeBindableNodeListener, setBind, setOnStack
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
 
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.FrameStateListener
allEventsComplete
 

Field Detail

PROJECTION_PERSPECTIVE

static final int PROJECTION_PERSPECTIVE
See Also:
Constant Field Values

PROJECTION_ORTHO

static final int PROJECTION_ORTHO
See Also:
Constant Field Values
Method Detail

addViewpointListener

void addViewpointListener(ViewpointListener l)
Add a ViewpointListener.

Parameters:
l - The listener. Duplicates and nulls are ignored.

removeViewpointListener

void removeViewpointListener(ViewpointListener l)
Remove a ViewpointListener.

Parameters:
l - The listener

getProjectionType

int getProjectionType()
Get the projection type.

Returns:
The type of projection. One of the PROJECTION_ constants.

getFieldOfView

float[] getFieldOfView()
Get the field of view used by this viewpoint. The value returned is an angle that is not less than zero and less than or equal to PI. The number of items in the list is dependant on the Viewpoint type.

Returns:
The field of view used by this viewpoint

getCenterOfRotation

float[] getCenterOfRotation()
Get the center of rotation defined by this viewpoint. The center of rotation is a point in space relative to the coordinate systems of this node.

Returns:
The position of the center of rotation

setCenterOfRotation

void setCenterOfRotation(float[] pos)
                         throws InvalidFieldValueException
Set the center of rotation of this viewpoint. The center is a position in 3-space.

Parameters:
pos - The new position to use
Throws:
InvalidFieldValueException - The field used is not 3 values

getJump

boolean getJump()
Get the Jump field value of this viewpoint.

Returns:
true if this viewpoint should jump to new positions

setJump

void setJump(boolean jump)
Set the jump field value of this viewpoint to the new value

Parameters:
jump - True if the viewpoint should jump to ne positions

getRetainUserOffsets

boolean getRetainUserOffsets()
Get the retainUserOffsets field value of this viewpoint.

Returns:
true if this viewpoint should retainUserOffsets on a bind

setRetainUserOffsets

void setRetainUserOffsets(boolean retainUserOffsets)
Set the retainUserOffsets field value of this viewpoint to the new value

Parameters:
retainUserOffsets - True if the viewpoint should retainUserOffsets on a bind

getDescription

java.lang.String getDescription()
Get the description string associated with this viewpoint. If no description is set, this will return null.

Returns:
The description string of this viewpoint

setDescription

void setDescription(java.lang.String desc)
Set the description string of this viewpoint. A zero length string or null will clear the currently set description.

Parameters:
desc - The new description to use

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium