Class 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 Detail

      • 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
    • 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
    • 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.