javax.media.j3d
Class WakeupOnCollisionMovement

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

public final class WakeupOnCollisionMovement
extends WakeupCriterion

Class specifying a wakeup when the specified object moves while in collision 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)  BoundingLeafRetained boundingLeaf
           
(package private) static int COLLIDEMOVE_IN_BS_LIST
           
(package private)  Bounds collidingBounds
           
(package private)  SceneGraphPath collidingPath
           
(package private) static int COND_IN_GS_LIST
           
(package private)  boolean duplicateEvent
           
(package private)  UnorderList geometryAtoms
          Geometry atoms that this wakeup condition refer to.
(package private)  Bounds lastDstBounds
           
(package private)  Bounds lastSrcBounds
           
(package private)  Bounds localBounds
           
(package private)  int nodeType
           
(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
WakeupOnCollisionMovement(Bounds armingBounds)
          Constructs a new WakeupOnCollisionMovement criterion.
WakeupOnCollisionMovement(Node armingNode)
          Constructs a new WakeupOnCollisionMovement criterion.
WakeupOnCollisionMovement(Node armingNode, int speedHint)
          Constructs a new WakeupOnCollisionMovement criterion.
WakeupOnCollisionMovement(SceneGraphPath armingPath)
          Constructs a new WakeupOnCollisionMovement criterion.
WakeupOnCollisionMovement(SceneGraphPath armingPath, int speedHint)
          Constructs a new WakeupOnCollisionMovement criterion.
WakeupOnCollisionMovement(SceneGraphPath armingPath, int speedHint, Bounds armingBounds)
          Constructs a new WakeupOnCollisionMovement 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.
 Bounds getTriggeringBounds()
          Retrieves the Bounds object that caused the collision
 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)
           
 
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

COLLIDEMOVE_IN_BS_LIST

static final int COLLIDEMOVE_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

accuracyMode

int accuracyMode
Accuracy mode one of USE_GEOMETRY or USE_BOUNDS


armingNode

NodeRetained armingNode

vwcBounds

Bounds vwcBounds

localBounds

Bounds localBounds

lastSrcBounds

Bounds lastSrcBounds

lastDstBounds

Bounds lastDstBounds

duplicateEvent

boolean duplicateEvent

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

collidingPath

SceneGraphPath collidingPath

collidingBounds

Bounds collidingBounds
Constructor Detail

WakeupOnCollisionMovement

public WakeupOnCollisionMovement(SceneGraphPath armingPath)
Constructs a new WakeupOnCollisionMovement criterion.

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.

WakeupOnCollisionMovement

public WakeupOnCollisionMovement(SceneGraphPath armingPath,
                                 int speedHint)
Constructs a new WakeupOnCollisionMovement 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.

WakeupOnCollisionMovement

public WakeupOnCollisionMovement(Node armingNode)
Constructs a new WakeupOnCollisionMovement 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.

WakeupOnCollisionMovement

public WakeupOnCollisionMovement(Node armingNode,
                                 int speedHint)
Constructs a new WakeupOnCollisionMovement 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.

WakeupOnCollisionMovement

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

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

WakeupOnCollisionMovement

WakeupOnCollisionMovement(SceneGraphPath armingPath,
                          int speedHint,
                          Bounds armingBounds)
Constructs a new WakeupOnCollisionMovement 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.

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)

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.