WakeupCondition example code

Create AWT event wakeup criterion

WakeupCriterion[] onMouseEvents = new WakeupCriterion[2];
onMouseEvents[0] = new WakeupOnAWTEvent( MouseEvent.MOUSE_PRESSED );
onMouseEvents[1] = new WakeupOnAWTEvent( MouseEvent.MOUSE_RELEASED );

Combine together those criterion

WakeupCondition onMouse = new WakeupOr( onMouseEvents );

Use that wakeupCondition into the Behavior methods


Create the behavior

Behavior myBeh = new MyBehavior( );

And set the behavior's wakup conditions and scheduling bounds Bounding

Sphere myBounds = new BoundingSphere(new Point3d( ), 1000.0 );
myBeh.setSchedulingBounds( myBounds );