javax.media.j3d
Class WakeupOnCollisionEntry

java.lang.Object
  extended by javax.media.j3d.WakeupCondition
      extended by javax.media.j3d.WakeupCriterion
          extended by javax.media.j3d.WakeupOnCollisionEntry

public final class WakeupOnCollisionEntry
extends WakeupCriterion

Class specifying a wakeup when the specified object collides with any other object in the scene graph.


Field Summary
(package private)  int accuracyMode
          Accuracy mode one of USE_GEOMETRY or USE_BOUNDS
(package private)  Bounds armingBounds
           
(package private)  NodeRetained armingNode
           
(package private)  SceneGraphPath armingPath
           
(package private) static int BOUND
           
(package private)  BoundingLeafRetained boundingLeaf
           
(package private) static int BOUNDINGLEAF
           
(package private) static int COLLIDEENTRY_IN_BS_LIST
           
(package private)  Bounds collidingBounds
           
(package private)  SceneGraphPath collidingPath
           
(package private) static int COND_IN_GS_LIST
           
(package private)  UnorderList geometryAtoms
          Geometry atoms that this wakeup condition refer to.
(package private) static int GROUP
           
(package private) static int MORPH
           
(package private)  int nodeType
           
(package private) static int ORIENTEDSHAPE3D
           
(package private) static int SHAPE
           
(package private) static int TOTAL_INDEXED_UNORDER_SET_TYPES
           
static int USE_BOUNDS
          Use geometric bounds as an approximation in computing collisions.
static int USE_GEOMETRY
          Use geometry in computing collisions.
(package private)  Bounds vwcBounds
           
 
Fields inherited from class javax.media.j3d.WakeupCriterion
triggered
 
Fields inherited from class javax.media.j3d.WakeupCondition
ALL_ELEMENTS, allEnum, behav, conditionMet, id, listIdx, parent, trigEnum, TRIGGERED_ELEMENTS
 
Constructor Summary
WakeupOnCollisionEntry(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.
WakeupOnCollisionEntry(SceneGraphPath armingPath, int speedHint, Bounds armingBounds)
          Constructs a new WakeupOnCollisionEntry criterion.
 
Method Summary
(package private)  void addBehaviorCondition(BehaviorStructure bs)
          This is a callback from BehaviorStructure.
 Bounds getArmingBounds()
          Returns the bounds object used in specifying the collision condition.
 SceneGraphPath getArmingPath()
          Returns the path used in specifying the collision condition.
(package private) static int getNodeType(NodeRetained armingNode, SceneGraphPath armingPath, java.lang.String s)
          Node legality checker throw Exception if node is not legal.
(package private) static SceneGraphPath getSceneGraphPath(GroupRetained group)
           
(package private) static SceneGraphPath getSceneGraphPath(NodeRetained startNode, HashKey key, Transform3D transform)
          return the SceneGraphPath of the geomAtom.
 Bounds getTriggeringBounds()
          Retrieves the Bounds object that caused the collision
(package private) static Bounds getTriggeringBounds(GroupRetained group)
          Return the TriggeringBounds for node
(package private) static Bounds getTriggeringBounds(Shape3DRetained mirrorShape)
          Return the TriggeringBounds for node
 SceneGraphPath getTriggeringPath()
          Retrieves the path describing the object causing the collision.
(package private)  void removeBehaviorCondition(BehaviorStructure bs)
          This is a callback from BehaviorStructure.
(package private)  void resetBehaviorCondition(BehaviorStructure bs)
          Perform task in addBehaviorCondition() that has to be set every time the condition met.
(package private)  void setTarget(BHLeafInterface leaf)
           
(package private)  void setTriggered()
          Set the Criterion's trigger flag to true.
(package private)  void updateCollisionBounds(boolean reEvaluateGAs)
           
(package private) static void validateSpeedHint(int speedHint, java.lang.String s)
          speedHint legality checker throw Exception if speedHint is not legal
 
Methods inherited from class javax.media.j3d.WakeupCriterion
buildTree, cleanTree, hasTriggered, resetTree
 
Methods inherited from class javax.media.j3d.WakeupCondition
allElements, reInsertElapseTimeCond, setConditionMet, triggeredElements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COND_IN_GS_LIST

static final int COND_IN_GS_LIST
See Also:
Constant Field Values

COLLIDEENTRY_IN_BS_LIST

static final int COLLIDEENTRY_IN_BS_LIST
See Also:
Constant Field Values

TOTAL_INDEXED_UNORDER_SET_TYPES

static final int TOTAL_INDEXED_UNORDER_SET_TYPES
See Also:
Constant Field Values

USE_GEOMETRY

public static final int USE_GEOMETRY
Use geometry in computing collisions.

See Also:
Constant Field Values

USE_BOUNDS

public static final int USE_BOUNDS
Use geometric bounds as an approximation in computing collisions.

See Also:
Constant Field Values

GROUP

static final int GROUP
See Also:
Constant Field Values

BOUNDINGLEAF

static final int BOUNDINGLEAF
See Also:
Constant Field Values

SHAPE

static final int SHAPE
See Also:
Constant Field Values

MORPH

static final int MORPH
See Also:
Constant Field Values

ORIENTEDSHAPE3D

static final int ORIENTEDSHAPE3D
See Also:
Constant Field Values

BOUND

static final int BOUND
See Also:
Constant Field Values

accuracyMode

int accuracyMode
Accuracy mode one of USE_GEOMETRY or USE_BOUNDS


armingNode

NodeRetained armingNode

vwcBounds

Bounds vwcBounds

boundingLeaf

BoundingLeafRetained boundingLeaf

geometryAtoms

UnorderList geometryAtoms
Geometry atoms that this wakeup condition refer to. Only use by SHAPE, MORPH, GROUP, ORIENTEDSHAPE


nodeType

int nodeType

armingPath

SceneGraphPath armingPath

armingBounds

Bounds armingBounds

collidingBounds

Bounds collidingBounds

collidingPath

SceneGraphPath collidingPath
Constructor Detail

WakeupOnCollisionEntry

public WakeupOnCollisionEntry(SceneGraphPath armingPath)
Constructs a new WakeupOnCollisionEntry criterion with USE_BOUNDS for a speed hint.

Parameters:
armingPath - the path used to arm collision detection
Throws:
java.lang.IllegalArgumentException - if object associated with the SceneGraphPath is other than a Group, Shape3D, Morph, or BoundingLeaf node.

WakeupOnCollisionEntry

public WakeupOnCollisionEntry(SceneGraphPath armingPath,
                              int speedHint)
Constructs a new WakeupOnCollisionEntry criterion.

Parameters:
armingPath - the path used to arm collision detection
speedHint - one of USE_GEOMETRY or USE_BOUNDS, specifies how accurately Java 3D will perform collision detection
Throws:
java.lang.IllegalArgumentException - if hint is not one of USE_GEOMETRY or USE_BOUNDS.
java.lang.IllegalArgumentException - if object associated with the SceneGraphPath is other than a Group, Shape3D, Morph, or BoundingLeaf node.

WakeupOnCollisionEntry

public WakeupOnCollisionEntry(Node armingNode)
Constructs a new WakeupOnCollisionEntry criterion.

Parameters:
armingNode - the Group, Shape, or Morph node used to arm collision detection
Throws:
java.lang.IllegalArgumentException - if object is under a SharedGroup node or object is other than a Group, Shape3D, Morph or BoundingLeaf node.

WakeupOnCollisionEntry

public WakeupOnCollisionEntry(Node armingNode,
                              int speedHint)
Constructs a new WakeupOnCollisionEntry criterion.

Parameters:
armingNode - the Group, Shape, or Morph node used to arm collision detection
speedHint - one of USE_GEOMETRY or USE_BOUNDS, specifies how accurately Java 3D will perform collision detection
Throws:
java.lang.IllegalArgumentException - if hint is not one of USE_GEOMETRY or USE_BOUNDS.
java.lang.IllegalArgumentException - if object is under a SharedGroup node or object is other than a Group, Shape3D, Morph or BoundingLeaf node.

WakeupOnCollisionEntry

public WakeupOnCollisionEntry(Bounds armingBounds)
Constructs a new WakeupOnCollisionEntry criterion.

Parameters:
armingBounds - the bounds object used to arm collision detection

WakeupOnCollisionEntry

WakeupOnCollisionEntry(SceneGraphPath armingPath,
                       int speedHint,
                       Bounds armingBounds)
Constructs a new WakeupOnCollisionEntry criterion.

Parameters:
armingPath - the path used to arm collision detection
speedHint - one of USE_GEOMETRY or USE_BOUNDS, specifies how accurately Java 3D will perform collision detection
armingBounds - the bounds object used to arm collision detection
Throws:
java.lang.IllegalArgumentException - if hint is not one of USE_GEOMETRY or USE_BOUNDS.
java.lang.IllegalArgumentException - if object associated with the SceneGraphPath is other than a Group, Shape3D, Morph, or BoundingLeaf node.
Method Detail

getArmingPath

public SceneGraphPath 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

public Bounds 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

public SceneGraphPath getTriggeringPath()
Retrieves the path describing the object causing the collision.

Returns:
the SceneGraphPath that describes the triggering object.
Throws:
java.lang.IllegalStateException - if not called from within the a behavior's processStimulus method which was awoken by a collision.

getTriggeringBounds

public Bounds getTriggeringBounds()
Retrieves the Bounds object that caused the collision

Returns:
the colliding Bounds object.
Throws:
java.lang.IllegalStateException - if not called from within the a behavior's processStimulus method which was awoken by a collision.

getNodeType

static int getNodeType(NodeRetained armingNode,
                       SceneGraphPath armingPath,
                       java.lang.String s)
                throws java.lang.IllegalArgumentException
Node legality checker throw Exception if node is not legal.

Returns:
nodeType
Throws:
java.lang.IllegalArgumentException

validateSpeedHint

static void validateSpeedHint(int speedHint,
                              java.lang.String s)
                       throws java.lang.IllegalArgumentException
speedHint legality checker throw Exception if speedHint is not legal

Throws:
java.lang.IllegalArgumentException

addBehaviorCondition

void addBehaviorCondition(BehaviorStructure bs)
This is a callback from BehaviorStructure. It is used to add wakeupCondition to behavior structure.

Specified by:
addBehaviorCondition in class WakeupCriterion

removeBehaviorCondition

void removeBehaviorCondition(BehaviorStructure bs)
This is a callback from BehaviorStructure. It is used to remove wakeupCondition from behavior structure.

Specified by:
removeBehaviorCondition in class WakeupCriterion

setTarget

void setTarget(BHLeafInterface leaf)

updateCollisionBounds

void updateCollisionBounds(boolean reEvaluateGAs)

getTriggeringBounds

static Bounds getTriggeringBounds(Shape3DRetained mirrorShape)
Return the TriggeringBounds for node


getTriggeringBounds

static Bounds getTriggeringBounds(GroupRetained group)
Return the TriggeringBounds for node


getSceneGraphPath

static SceneGraphPath getSceneGraphPath(GroupRetained group)

getSceneGraphPath

static SceneGraphPath getSceneGraphPath(NodeRetained startNode,
                                        HashKey key,
                                        Transform3D transform)
return the SceneGraphPath of the geomAtom. Find the alternative Collision target closest to the locale.


setTriggered

void setTriggered()
Description copied from class: WakeupCriterion
Set the Criterion's trigger flag to true.

Overrides:
setTriggered in class WakeupCriterion

resetBehaviorCondition

void resetBehaviorCondition(BehaviorStructure bs)
Perform task in addBehaviorCondition() that has to be set every time the condition met.

Specified by:
resetBehaviorCondition in class WakeupCriterion


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.