Hi Magnus,
In v1.2, whenever there is no behaviors/scene graph change
(and no interpolators use), WakeupOnElapsedFrames will
not schedule to trigger since there is no need to render.
In your code, when the object collide, the behavior in
processStimulus() did not change the scene graph,
so Java3D renderer did notrender the scene graph for the
next frame and WakeupOnElapsedFrames will not trigger
again. Therefore, the object appear to stop moving. This
is an expect behavior in v1.2. WakeupOnElapsedTime will
works in your case as it gaurantees processStimulus()
triggered every certain time to change the scene graph.
Thanks.
- Kelvin
---------------
Java3D team
Sun Microsystems Inc.
>----- Begin Included Message -----
>
>Date: Tue, 23 Nov 1999 14:10:54 +0100
>From: Magnus Andersson <[EMAIL PROTECTED]>
>Subject: [JAVA3D] WakeupOnCollisionMovement???
>To: [EMAIL PROTECTED]
>
>I have a problem with this when also using WakeupOnElapsedFrames.
>
>The code I am using is like this:
>
> public void initialize() {
> wakeupEvents = new WakeupCriterion[3];
> wakeupEvents[0] = new WakeupOnElapsedFrames(1);
> wakeupEvents[1] = new WakeupOnCollisionEntry(shape);
> wakeupEvents[2] = new WakeupOnCollisionMovement(shape);
> wakeupCriterion = new WakeupOr(wakeupEvents);
> wakeupOn (wakeupCriterion);
> }
>
> public void processStimulus (Enumeration criteria)
> {
> WakeupCriterion wakeup;
>
> while (criteria.hasMoreElements())
> {
> wakeup = (WakeupCriterion) criteria.nextElement();
>
> // Frame update
> if (wakeup instanceof WakeupOnElapsedFrames) {
> // Moving the object
> }
>
> // When colliding with an other object
> else if (wakeup instanceof WakeupOnCollisionEntry) {
> // Set different states for moving object
> }
> else {
> // CollisionMovement...
> }
> }
>
> wakeupOn (wakeupCriterion);
> }
>
>What is happening is that the object moves fine untill it enters an object
>and WakeupOnCollisionEntry i triggered. After that it triggers the
>WakeupOnCollisionMovement and are not doing anything else even if
>there is nothing else done in the CollisionMovement part... =(
>In other words the object stops! Even if the object has stopped (is not
>moving) the WakeupOnCollisionMovement triggers...
>
>Using WakeupOnElapsedTime works fine but not with WakeupOnElapsedFrames...
>Why??
>
>Please help me...
>
>.--------------------------.
> M. Andersson ///
> [EMAIL PROTECTED] ///
> www.acc.umu.se/~menthos/ \\\///
> hem.passagen.se/menthos/ \XX/
>'--------------------------'
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff JAVA3D-INTEREST". For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
>
>
>----- End Included Message -----
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".