Package javax.media.j3d
Class Clip
- java.lang.Object
-
- javax.media.j3d.SceneGraphObject
-
- javax.media.j3d.Node
-
- javax.media.j3d.Leaf
-
- javax.media.j3d.Clip
-
public class Clip extends Leaf
The Clip leaf node defines the back, or far, clip distance in the virtual universe. The distance is specified in the local coordinate system of this node. This node also specifies an application region in which this clip node is active. A Clip node is active when its application region intersects the ViewPlatform's activation volume. If multiple Clip nodes are active, the Clip node that is "closest" to the eye will be used. If no clip node is in scope of the view platform associated with the current view, then the back clip distance is defined by the View object. The front clip distance is always defined by the View object.- See Also:
View
-
-
Field Summary
Fields Modifier and Type Field Description static intALLOW_APPLICATION_BOUNDS_READSpecifies that the Clip allows read access to its application bounds and bounding leaf at runtime.static intALLOW_APPLICATION_BOUNDS_WRITESpecifies that the Clip allows write access to its application bounds and bounding leaf at runtime.static intALLOW_BACK_DISTANCE_READSpecifies that the Clip allows read access to its back distance at runtime.static intALLOW_BACK_DISTANCE_WRITESpecifies that the Clip allows write access to its back distance 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_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodecloneNode(boolean forceDuplicate)Used to create a new instance of the node.BoundingLeafgetApplicationBoundingLeaf()Retrieves the Clip node's application bounding leaf.BoundsgetApplicationBounds()Retrieves the Clip node's application bounds.doublegetBackDistance()Retrieves the back clip distance.voidsetApplicationBoundingLeaf(BoundingLeaf region)Set the Clip's application region to the specified bounding leaf.voidsetApplicationBounds(Bounds region)Set the Clip's application region to the specified bounds.voidsetBackDistance(double backDistance)Sets the back clip distance to the specified value.voidupdateNodeReferences(NodeReferenceTable referenceTable)Callback used to allow a node to check if any scene graph objects referenced by that node have been duplicated via a call tocloneTree.-
Methods inherited from class javax.media.j3d.Node
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
-
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString
-
-
-
-
Field Detail
-
ALLOW_APPLICATION_BOUNDS_READ
public static final int ALLOW_APPLICATION_BOUNDS_READ
Specifies that the Clip allows read access to its application bounds and bounding leaf at runtime.- See Also:
- Constant Field Values
-
ALLOW_APPLICATION_BOUNDS_WRITE
public static final int ALLOW_APPLICATION_BOUNDS_WRITE
Specifies that the Clip allows write access to its application bounds and bounding leaf at runtime.- See Also:
- Constant Field Values
-
ALLOW_BACK_DISTANCE_READ
public static final int ALLOW_BACK_DISTANCE_READ
Specifies that the Clip allows read access to its back distance at runtime.- See Also:
- Constant Field Values
-
ALLOW_BACK_DISTANCE_WRITE
public static final int ALLOW_BACK_DISTANCE_WRITE
Specifies that the Clip allows write access to its back distance at runtime.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Clip
public Clip()
Constructs a Clip node with default parameters. The default values are as follows:-
back clip distance : 100 meters
application bounds : null
application bounding leaf : null
-
Clip
public Clip(double backDistance)
Constructs a Clip node with the specified back clip distance.
-
-
Method Detail
-
setBackDistance
public void setBackDistance(double backDistance)
Sets the back clip distance to the specified value. There are several considerations that need to be taken into account when choosing values for the front and back clip distances. These are enumerated in the description of View.setFrontClipDistance.- Parameters:
backDistance- the new back clip distance in meters- See Also:
View.setFrontClipDistance(double),View.setBackClipDistance(double)
-
getBackDistance
public double getBackDistance()
Retrieves the back clip distance.- Returns:
- the current back clip distance, in meters
-
setApplicationBounds
public void setApplicationBounds(Bounds region)
Set the Clip's application region to the specified bounds. This is used when the application bounding leaf is set to null.- Parameters:
region- the bounds that contains the Clip's new application region.- Throws:
CapabilityNotSetException- if appropriate capability is not set and this object is part of live or compiled scene graph
-
getApplicationBounds
public Bounds getApplicationBounds()
Retrieves the Clip node's application bounds.- Returns:
- this Clip's application bounds information
- Throws:
CapabilityNotSetException- if appropriate capability is not set and this object is part of live or compiled scene graph
-
setApplicationBoundingLeaf
public void setApplicationBoundingLeaf(BoundingLeaf region)
Set the Clip's application region to the specified bounding leaf. When set to a value other than null, this overrides the application bounds object.- Parameters:
region- the bounding leaf node used to specify the Clip node's new application region.- Throws:
CapabilityNotSetException- if appropriate capability is not set and this object is part of live or compiled scene graph
-
getApplicationBoundingLeaf
public BoundingLeaf getApplicationBoundingLeaf()
Retrieves the Clip node's application bounding leaf.- Returns:
- this Clip's application bounding leaf information
- Throws:
CapabilityNotSetException- if appropriate capability is not set and this object is part of live or compiled scene graph
-
cloneNode
public Node cloneNode(boolean forceDuplicate)
Used to create a new instance of the node. This routine is called bycloneTreeto duplicate the current node.- Overrides:
cloneNodein classNode- Parameters:
forceDuplicate- when set totrue, causes theduplicateOnCloneTreeflag to be ignored. Whenfalse, the value of each node'sduplicateOnCloneTreevariable determines whether NodeComponent data is duplicated or copied.- See Also:
Node.cloneTree(),Node.cloneNode(boolean),Node.duplicateNode(javax.media.j3d.Node, boolean),NodeComponent.setDuplicateOnCloneTree(boolean)
-
updateNodeReferences
public void updateNodeReferences(NodeReferenceTable referenceTable)
Callback used to allow a node to check if any scene graph objects referenced by that node have been duplicated via a call tocloneTree. This method is called bycloneTreeafter all nodes in the sub-graph have been duplicated. The cloned Leaf node's method will be called and the Leaf node can then look up any object references by using thegetNewObjectReferencemethod found in theNodeReferenceTableobject. If a match is found, a reference to the corresponding object in the newly cloned sub-graph is returned. If no corresponding reference is found, either a DanglingReferenceException is thrown or a reference to the original object is returned depending on the value of theallowDanglingReferencesparameter passed in thecloneTreecall.NOTE: Applications should not call this method directly. It should only be called by the cloneTree method.
- Overrides:
updateNodeReferencesin classSceneGraphObject- Parameters:
referenceTable- a NodeReferenceTableObject that contains thegetNewObjectReferencemethod needed to search for new object instances.- See Also:
NodeReferenceTable,Node.cloneTree(),DanglingReferenceException
-
-