Package javax.media.j3d
Class WakeupOnCollisionEntry
java.lang.Object
javax.media.j3d.WakeupCondition
javax.media.j3d.WakeupCriterion
javax.media.j3d.WakeupOnCollisionEntry
Class specifying a wakeup when the specified object
collides with any other object in the scene graph.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Use geometric bounds as an approximation in computing collisions.static final int
Use geometry in computing collisions. -
Constructor Summary
ConstructorsConstructorDescriptionWakeupOnCollisionEntry
(Bounds armingBounds) Constructs a new WakeupOnCollisionEntry criterion.WakeupOnCollisionEntry
(Node armingNode) Constructs a new WakeupOnCollisionEntry criterion.WakeupOnCollisionEntry
(Node armingNode, int speedHint) Constructs a new WakeupOnCollisionEntry criterion.WakeupOnCollisionEntry
(SceneGraphPath armingPath) Constructs a new WakeupOnCollisionEntry criterion with USE_BOUNDS for a speed hint.WakeupOnCollisionEntry
(SceneGraphPath armingPath, int speedHint) Constructs a new WakeupOnCollisionEntry criterion. -
Method Summary
Modifier and TypeMethodDescriptionReturns the bounds object used in specifying the collision condition.Returns the path used in specifying the collision condition.Retrieves the Bounds object that caused the collisionRetrieves the path describing the object causing the collision.Methods inherited from class javax.media.j3d.WakeupCriterion
hasTriggered
Methods inherited from class javax.media.j3d.WakeupCondition
allElements, triggeredElements
-
Field Details
-
USE_GEOMETRY
public static final int USE_GEOMETRYUse geometry in computing collisions.- See Also:
-
USE_BOUNDS
public static final int USE_BOUNDSUse geometric bounds as an approximation in computing collisions.- See Also:
-
-
Constructor Details
-
WakeupOnCollisionEntry
Constructs a new WakeupOnCollisionEntry criterion with USE_BOUNDS for a speed hint.- Parameters:
armingPath
- the path used to arm collision detection- Throws:
IllegalArgumentException
- if object associated with the SceneGraphPath is other than a Group, Shape3D, Morph, or BoundingLeaf node.
-
WakeupOnCollisionEntry
Constructs a new WakeupOnCollisionEntry criterion.- Parameters:
armingPath
- the path used to arm collision detectionspeedHint
- one of USE_GEOMETRY or USE_BOUNDS, specifies how accurately Java 3D will perform collision detection- Throws:
IllegalArgumentException
- if hint is not one of USE_GEOMETRY or USE_BOUNDS.IllegalArgumentException
- if object associated with the SceneGraphPath is other than a Group, Shape3D, Morph, or BoundingLeaf node.
-
WakeupOnCollisionEntry
Constructs a new WakeupOnCollisionEntry criterion.- Parameters:
armingNode
- the Group, Shape, or Morph node used to arm collision detection- Throws:
IllegalArgumentException
- if object is under a SharedGroup node or object is other than a Group, Shape3D, Morph or BoundingLeaf node.
-
WakeupOnCollisionEntry
Constructs a new WakeupOnCollisionEntry criterion.- Parameters:
armingNode
- the Group, Shape, or Morph node used to arm collision detectionspeedHint
- one of USE_GEOMETRY or USE_BOUNDS, specifies how accurately Java 3D will perform collision detection- Throws:
IllegalArgumentException
- if hint is not one of USE_GEOMETRY or USE_BOUNDS.IllegalArgumentException
- if object is under a SharedGroup node or object is other than a Group, Shape3D, Morph or BoundingLeaf node.
-
WakeupOnCollisionEntry
Constructs a new WakeupOnCollisionEntry criterion.- Parameters:
armingBounds
- the bounds object used to arm collision detection
-
-
Method Details
-
getArmingPath
Returns the path used in specifying the collision condition.- Returns:
- the SceneGraphPath object generated when arming this criterion---null implies that a bounds object armed this criteria
-
getArmingBounds
Returns the bounds object used in specifying the collision condition.- Returns:
- the Bounds object generated when arming this criterion---null implies that a SceneGraphPath armed this criteria
-
getTriggeringPath
Retrieves the path describing the object causing the collision.- Returns:
- the SceneGraphPath that describes the triggering object.
- Throws:
IllegalStateException
- if not called from within the a behavior's processStimulus method which was awoken by a collision.
-
getTriggeringBounds
Retrieves the Bounds object that caused the collision- Returns:
- the colliding Bounds object.
- Throws:
IllegalStateException
- if not called from within the a behavior's processStimulus method which was awoken by a collision.
-