Example usage for javax.media.j3d WakeupOnCollisionMovement WakeupOnCollisionMovement

List of usage examples for javax.media.j3d WakeupOnCollisionMovement WakeupOnCollisionMovement

Introduction

In this page you can find the example usage for javax.media.j3d WakeupOnCollisionMovement WakeupOnCollisionMovement.

Prototype

public WakeupOnCollisionMovement(Bounds armingBounds) 

Source Link

Document

Constructs a new WakeupOnCollisionMovement criterion.

Usage

From source file:SimpleCollision.java

/**
 * This creates an entry, exit and movement collision criteria. These are
 * then OR'ed together, and the wake up condition set to the result.
 *//*from   w ww  . ja va2  s .co m*/
public void initialize() {
    theCriteria = new WakeupCriterion[3];
    theCriteria[0] = new WakeupOnCollisionEntry(collidingShape);
    theCriteria[1] = new WakeupOnCollisionExit(collidingShape);
    theCriteria[2] = new WakeupOnCollisionMovement(collidingShape);
    oredCriteria = new WakeupOr(theCriteria);
    wakeupOn(oredCriteria);
}

From source file:SimpleCollision2.java

/**
 * This sets up the criteria for triggering the behaviour. It creates an
 * entry, exit and movement trigger, OR's these together and then sets the
 * OR'ed criterion as the wake up condition.
 *//*from www .j av a 2  s . c  om*/
public void initialize() {
    theCriteria = new WakeupCriterion[3];
    WakeupOnCollisionEntry startsCollision = new WakeupOnCollisionEntry(collidingShape);
    WakeupOnCollisionExit endsCollision = new WakeupOnCollisionExit(collidingShape);
    WakeupOnCollisionMovement moveCollision = new WakeupOnCollisionMovement(collidingShape);
    theCriteria[0] = startsCollision;
    theCriteria[1] = endsCollision;
    theCriteria[2] = moveCollision;
    oredCriteria = new WakeupOr(theCriteria);
    wakeupOn(oredCriteria);
}