javax.media.j3d
Class ViewPlatform
java.lang.Object
|
+--javax.media.j3d.SceneGraphObject
|
+--javax.media.j3d.Node
|
+--javax.media.j3d.Leaf
|
+--javax.media.j3d.ViewPlatform
- public class ViewPlatform
- extends Leaf
The ViewPlatform leaf node object controls the position, orientation
and scale of the viewer. It is the node in the scene graph that a
View object connects to.
- See Also:
View
Field Summary |
static int |
ALLOW_POLICY_READ
Specifies that the ViewPlatform allows read access to its view
attach policy information at runtime. |
static int |
ALLOW_POLICY_WRITE
Specifies that the ViewPlatform allows write access to its view
attach policy information at runtime. |
Fields inherited from class javax.media.j3d.Node |
ALLOW_AUTO_COMPUTE_BOUNDS_READ,
ALLOW_AUTO_COMPUTE_BOUNDS_WRITE,
ALLOW_BOUNDS_READ,
ALLOW_BOUNDS_WRITE,
ALLOW_COLLIDABLE_READ,
ALLOW_COLLIDABLE_WRITE,
ALLOW_LOCAL_TO_VWORLD_READ,
ALLOW_PICK,
ALLOW_PICKABLE_READ,
ALLOW_PICKABLE_WRITE,
ENABLE_COLLISION_REPORTING,
ENABLE_PICK_REPORTING |
Constructor Summary |
ViewPlatform()
Constructs a ViewPlatform object with default parameters. |
Method Summary |
Node |
cloneNode(boolean forceDuplicate)
Used to create a new instance of the node. |
void |
duplicateNode(Node originalNode,
boolean forceDuplicate)
Copies all node information from originalNode into
the current node. |
float |
getActivationRadius()
Get the ViewPlatform's activation radius. |
int |
getViewAttachPolicy()
Returns the current coexistence center in virtual-world policy. |
void |
setActivationRadius(float activationRadius)
Set the ViewPlatform's activation radius which defines an activation
volume around the view platform. |
void |
setViewAttachPolicy(int policy)
Sets the view attach policy that determines the coexistence center
in the virtual world. |
Methods inherited from class javax.media.j3d.Node |
cloneTree,
cloneTree,
cloneTree,
getBounds,
getBoundsAutoCompute,
getCollidable,
getLocalToVworld,
getLocalToVworld,
getParent,
getPickable,
setBounds,
setBoundsAutoCompute,
setCollidable,
setPickable |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
ALLOW_POLICY_READ
public static final int ALLOW_POLICY_READ
- Specifies that the ViewPlatform allows read access to its view
attach policy information at runtime.
ALLOW_POLICY_WRITE
public static final int ALLOW_POLICY_WRITE
- Specifies that the ViewPlatform allows write access to its view
attach policy information at runtime.
ViewPlatform
public ViewPlatform()
- Constructs a ViewPlatform object with default parameters.
The default values are as follows:
view attach policy : View.NOMINAL_HEAD
activation radius : 62
setViewAttachPolicy
public final void setViewAttachPolicy(int policy)
- Sets the view attach policy that determines the coexistence center
in the virtual world. This policy determines how Java 3D places the
view platform relative to the position of the user's head, one of
View.NOMINAL_SCREEN, View.NOMINAL_HEAD, or View.NOMINAL_FEET.
The default policy is View.NOMINAL_HEAD.
- Parameters:
policy
- the new policy- Throws:
- CapabilityNotSetException - if appropriate capability is
not set and this object is part of live or compiled scene graph
- See Also:
View.NOMINAL_SCREEN
,
View.NOMINAL_HEAD
,
View.NOMINAL_FEET
getViewAttachPolicy
public final int getViewAttachPolicy()
- Returns the current coexistence center in virtual-world policy.
- Returns:
- one of: View.NOMINAL_SCREEN, View.NOMINAL_HEAD, or
View.NOMINAL_FEET
- Throws:
- CapabilityNotSetException - if appropriate capability is
not set and this object is part of live or compiled scene graph
setActivationRadius
public final void setActivationRadius(float activationRadius)
- Set the ViewPlatform's activation radius which defines an activation
volume around the view platform.
- Parameters:
activationRadius
- the new activation radius
getActivationRadius
public final float getActivationRadius()
- Get the ViewPlatform's activation radius.
- Returns:
- the ViewPlatform activation radius
cloneNode
public Node cloneNode(boolean forceDuplicate)
- Used to create a new instance of the node. This routine is called
by
cloneTree
to duplicate the current node.
cloneNode
should be overridden by any user subclassed
objects. All subclasses must have their cloneNode
method consist of the following lines:
public Node cloneNode(boolean forceDuplicate) {
UserSubClass usc = new UserSubClass();
usc.duplicateNode(this, forceDuplicate);
return usc;
}
- Overrides:
- cloneNode in class Node
- Parameters:
forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When
false
, the value of each node's
duplicateOnCloneTree
variable determines whether
NodeComponent data is duplicated or copied.- See Also:
Node.cloneTree()
,
Node.duplicateNode(javax.media.j3d.Node, boolean)
,
NodeComponent.setDuplicateOnCloneTree(boolean)
duplicateNode
public void duplicateNode(Node originalNode,
boolean forceDuplicate)
- Copies all node information from
originalNode
into
the current node. This method is called from the
cloneNode
method which is, in turn, called by the
cloneTree
method.
For any NodeComponent objects
contained by the object being duplicated, each NodeComponent
object's duplicateOnCloneTree
value is used to determine
whether the NodeComponent should be duplicated in the new node
or if just a reference to the current node should be placed in the
new node. This flag can be overridden by setting the
forceDuplicate
parameter in the cloneTree
method to true
.
- Overrides:
- duplicateNode in class Node
- Parameters:
originalNode
- the original node to duplicate.forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When
false
, the value of each node's
duplicateOnCloneTree
variable determines whether
NodeComponent data is duplicated or copied.- See Also:
Node.cloneTree()
,
Node.cloneNode(boolean)
,
NodeComponent.setDuplicateOnCloneTree(boolean)