|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.j3d.SceneGraphObject | +--javax.media.j3d.Node | +--javax.media.j3d.Leaf | +--javax.media.j3d.ModelClip
The ModelClip leaf node defines a set of 6 arbitrary clipping planes in the virtual universe. The planes are specified in the local coordinate system of this node, and may be individually enabled or disabled. This node also specifies a region of influence in which this set of planes is active.
A ModelClip node also contains a list of Group nodes that specifies the hierarchical scope of this ModelClip. If the scope list is empty, then the ModelClip node has universe scope: all nodes within the region of influence are affected by this ModelClip node. If the scope list is non-empty, then only those Leaf nodes under the Group nodes in the scope list are affected by this ModelClip node (subject to the influencing bounds).
If the regions of influence of multiple ModelClip nodes overlap, the Java 3D system will choose a single set of model clip planes for those objects that lie in the intersection. This is done in an implementation-dependent manner, but in general, the ModelClip node that is "closest" to the object is chosen.
The individual planes specify a half-space defined by the equation:
Field Summary | |
static int |
ALLOW_ENABLE_READ
Specifies that the ModelClip node allows read access to its enable flags at runtime. |
static int |
ALLOW_ENABLE_WRITE
Specifies that the ModelClip node allows write access to its enable flags at runtime. |
static int |
ALLOW_INFLUENCING_BOUNDS_READ
Specifies that the ModelClip node allows read access to its influencing bounds and bounding leaf at runtime. |
static int |
ALLOW_INFLUENCING_BOUNDS_WRITE
Specifies that the ModelClip node allows write access to its influencing bounds and bounding leaf at runtime. |
static int |
ALLOW_PLANE_READ
Specifies that the ModelClip node allows read access to its planes at runtime. |
static int |
ALLOW_PLANE_WRITE
Specifies that the ModelClip node allows write access to its planes at runtime. |
static int |
ALLOW_SCOPE_READ
Specifies that this ModelClip node allows read access to its scope information at runtime. |
static int |
ALLOW_SCOPE_WRITE
Specifies that this ModelClip node allows write access to its scope 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_PICKABLE_READ,
ALLOW_PICKABLE_WRITE,
ENABLE_COLLISION_REPORTING,
ENABLE_PICK_REPORTING |
Constructor Summary | |
ModelClip()
Constructs a ModelClip node with default parameters. |
|
ModelClip(Vector4d[] planes)
Constructs a ModelClip node using the specified planes. |
|
ModelClip(Vector4d[] planes,
boolean[] enables)
Constructs a ModelClip node using the specified planes and enable flags. |
Method Summary | |
void |
addScope(Group scope)
Appends the specified Group node to this ModelClip node's list of scopes. |
Node |
cloneNode(boolean forceDuplicate)
Used to create a new instance of the node. |
java.util.Enumeration |
getAllScopes()
Returns an enumeration of this ModelClip node's list of scopes. |
boolean |
getEnable(int planeNum)
Retrieves the specified enable flag from this ModelClip node. |
void |
getEnables(boolean[] enables)
Retrieves the per-plane enable flags from this ModelClip node. |
BoundingLeaf |
getInfluencingBoundingLeaf()
Retrieves the ModelClip node's influencing bounding leaf. |
Bounds |
getInfluencingBounds()
Retrieves the ModelClip node's influencing bounds. |
void |
getPlane(int planeNum,
Vector4d plane)
Retrieves the specified clipping plane from this ModelClip node. |
void |
getPlanes(Vector4d[] planes)
Retrieves the clipping planes from this ModelClip node. |
Group |
getScope(int index)
Retrieves the Group node at the specified index from this ModelClip node's list of scopes. |
void |
insertScope(Group scope,
int index)
Inserts the specified Group node into this ModelClip node's list of scopes at the specified index. |
int |
numScopes()
Returns the number of nodes in this ModelClip node's list of scopes. |
void |
removeScope(int index)
Removes the node at the specified index from this ModelClip node's list of scopes. |
void |
setEnable(int planeNum,
boolean enable)
Sets the specified enable flag of this ModelClip node. |
void |
setEnables(boolean[] enables)
Sets the per-plane enable flags of this ModelClip node to the specified values. |
void |
setInfluencingBoundingLeaf(BoundingLeaf region)
Set the ModelClip node's influencing region to the specified bounding leaf. |
void |
setInfluencingBounds(Bounds region)
Set the ModelClip node's influencing region to the specified bounds. |
void |
setPlane(int planeNum,
Vector4d plane)
Sets the specified clipping plane of this ModelClip node. |
void |
setPlanes(Vector4d[] planes)
Sets the clipping planes of this ModelClip node to the specified planes. |
void |
setScope(Group scope,
int index)
Replaces the node at the specified index in this ModelClip node's list of scopes with the specified Group node. |
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 to cloneTree . |
Methods inherited from class javax.media.j3d.Node |
cloneTree,
cloneTree,
cloneTree,
cloneTree,
cloneTree,
cloneTree,
duplicateNode,
getBounds,
getBoundsAutoCompute,
getCollidable,
getLocalToVworld,
getLocalToVworld,
getParent,
getPickable,
setBounds,
setBoundsAutoCompute,
setCollidable,
setPickable |
Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability,
duplicateSceneGraphObject,
getCapability,
getUserData,
isCompiled,
isLive,
setCapability,
setUserData |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int ALLOW_INFLUENCING_BOUNDS_READ
public static final int ALLOW_INFLUENCING_BOUNDS_WRITE
public static final int ALLOW_PLANE_READ
public static final int ALLOW_PLANE_WRITE
public static final int ALLOW_ENABLE_READ
public static final int ALLOW_ENABLE_WRITE
public static final int ALLOW_SCOPE_READ
public static final int ALLOW_SCOPE_WRITE
Constructor Detail |
public ModelClip()
public ModelClip(Vector4d[] planes)
planes
- an array of 6 model clipping planespublic ModelClip(Vector4d[] planes, boolean[] enables)
planes
- an array of 6 model clipping planesenables
- an array of 6 enable flagsMethod Detail |
public void setInfluencingBounds(Bounds region)
region
- the bounds that contains the new influencing
region.public Bounds getInfluencingBounds()
public void setInfluencingBoundingLeaf(BoundingLeaf region)
region
- the bounding leaf node used to specify the
new influencing region.public BoundingLeaf getInfluencingBoundingLeaf()
public void setScope(Group scope, int index)
scope
- the Group node to be stored at the specified index.index
- the index of the Group node to be replaced.public Group getScope(int index)
index
- the index of the Group node to be returned.public void insertScope(Group scope, int index)
scope
- the Group node to be inserted at the specified index.index
- the index at which the Group node is inserted.public void removeScope(int index)
index
- the index of the Group node to be removed.public java.util.Enumeration getAllScopes()
public void addScope(Group scope)
scope
- the Group node to be appended.public int numScopes()
public void setPlanes(Vector4d[] planes)
planes
- an array of 6 model clipping planespublic void getPlanes(Vector4d[] planes)
planes
- an array of 6 vectors that will receive the model
clipping planes from this nodepublic void setPlane(int planeNum, Vector4d plane)
planeNum
- specifies which model clipping plane (0-5) is replacedplane
- new model clipping planepublic void getPlane(int planeNum, Vector4d plane)
planeNum
- specifies which model clipping plane (0-5) is retrievedplane
- a vector that will receive the specified model
clipping plane from this nodepublic void setEnables(boolean[] enables)
enables
- an array of 6 enable flagspublic void getEnables(boolean[] enables)
enables
- an array of 6 booleans that will receive the
enable flags from this nodepublic void setEnable(int planeNum, boolean enable)
planeNum
- specifies which enable flag (0-5) is setenable
- new enable flagpublic boolean getEnable(int planeNum)
planeNum
- specifies which enable flag (0-5) is retrievedpublic Node cloneNode(boolean forceDuplicate)
cloneTree
to duplicate the current node.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.Node.cloneTree()
,
Node.cloneNode(boolean)
,
Node.duplicateNode(javax.media.j3d.Node, boolean)
,
NodeComponent.setDuplicateOnCloneTree(boolean)
public void updateNodeReferences(NodeReferenceTable referenceTable)
cloneTree
.
This method is called by cloneTree
after 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 the getNewObjectReference
method found in the
NodeReferenceTable
object. 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 the
allowDanglingReferences
parameter passed in the
cloneTree
call.
NOTE: Applications should not call this method directly. It should only be called by the cloneTree method.
referenceTable
- a NodeReferenceTableObject that contains the
getNewObjectReference
method needed to search for
new object instances.NodeReferenceTable
,
Node.cloneTree()
,
DanglingReferenceException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |