Hello,

 I've seen no response to my question.  Has anyone here gotten
WakeupOnViewPlatformEntry to work?

Thanks,
-Gary
---------------------- Forwarded by Gary Moss/arl on 07/28/99 12:15 PM
---------------------------


"Gary S. Moss" <[EMAIL PROTECTED]> on 07/22/99 04:58:15 PM
To: [EMAIL PROTECTED]
cc:  (bcc: Gary Moss/arl)
Subject: [JAVA3D] WakeUpOnViewPlatformEntry only fires one time!


Hello,

 I finally got around to messing with collision detection between my view
platform and scene.  Everything works the first time the view platform
collides, I get a WakeupOnViewPlatformEntry and corresponding Exit when
appropriate.   However subsequently I can never seem to get another Entry,
though Exit fires consistently.   I vaguely remember reading about a similar
problem on this list, but don't recall whether it was a bug in J3d or operator
error.  I am using JDK 1.2.2 and Java3d 1.1.2 OpenGl under WinNT 4.0 SP5.   My
code follows (my apologies if tabs get farbled in translation):

TIA,
-Gary

--
import java.util.*;
import javax.media.j3d.*;

public class CollisionBehavior extends Behavior
 {
 private WakeupCondition criterion;
   private Bounds bounds;
   private boolean collided;

 public CollisionBehavior( Bounds bnds )
  {
  super();
  this.bounds = bnds;
      collided = false;
      //System.err.println( "CollisonBehavior( " + bnds + " )" );
  }

 public void initialize()
  {
  WakeupCriterion[] allEvents = new WakeupCriterion[2];
   allEvents[0] = new WakeupOnViewPlatformEntry( bounds );
    allEvents[1] = new WakeupOnViewPlatformExit( bounds );
  criterion = new WakeupOr( allEvents );
  wakeupOn( criterion );
  }

 public void processStimulus( Enumeration criteria )
  {
  WakeupCriterion wakeup;

  while( criteria.hasMoreElements() )
   {
   wakeup = (WakeupCriterion) criteria.nextElement();

   if( wakeup instanceof WakeupOnViewPlatformEntry )
    {
           System.err.println( "Entered View Platform" );
            collided = true;
    }
         else
         if( wakeup instanceof WakeupOnViewPlatformExit )
            {
            System.err.println( "Exited View Platform" );
            collided = false;
            }
   }
  wakeupOn( criterion );
  }

  public boolean IsCollided()
    {
    return collided;
    }
  }

===========================================================================
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".

===========================================================================
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".

Reply via email to