< Zurück | Inhalt | Weiter >

11.5 Overview of Wakeup criteria

Java 3D includes 14 Wakeup criteria (or triggers) for Behaviors. These simple criteria are specified and derived from the WakeupCriterion class. In addition, Boolean combinations of simple criteria can be specified using the classes derived from WakeupCondition.


For example, you can either define a Behavior that is activated every time an object is moved (i.e.,

WakeupOnTransformChange, which is a WakeupCriterion): wakeupOn( new WakeupOnTransformChange( tg ) );

Or define a Behavior that is activated every time an object is moved and a specified number of frames have elapsed (i.e., WakeupAnd, which is a WakeupCondition):


WakeupCriterion criterionArray[] = new WakeupCriterion[2]; criterionArray[0] = new WakeupOnTransformChange( tg ); criterionArray[1] = new WakeupOnElapsedFrames( 20 );


WakeupCondition wakeUpCondition = new WakeupAnd( criterionArray ); wakeupOn( wakeUpCondition );


 

WakeupCriterion
WakeupCondition
From StretchBehavior.java
Summary