Hi BamBam,

   Is inCollision initialize to false when start ? If the
conditon that trigger it wExit, then wEnter.getTriggeringPath()
will return null.  (also, wEnter.getTriggeringPath() is
comment out in the source). If this bug happens in v1.2.1
or later, please send us a test case.

Thanks.

- Kelvin
--------------
Java 3D Team
Sun Microsystems Inc.

>X-Unix-From: [EMAIL PROTECTED]  Tue May 29 21:28:16 2001
>Mime-Version: 1.0
>X-BadHeader: plain
>Date: Tue, 29 May 2001 10:37:43 +0800
>From: BAMBAM <[EMAIL PROTECTED]>
>Subject: [JAVA3D] WakeuponCollisionentry
>To: [EMAIL PROTECTED]
>
>Hi!
>
>I have spheres and cylinders in my virtual universe and have Wakeuponcollisionentry 
>as its
condition for its behaviors.
>
>Here are my initialize and processstimulus methods:
>
>
>    public void initialize() {
>        wEnter = new WakeupOnCollisionEntry(shape, 
>WakeupOnCollisionEntry.USE_GEOMETRY);
>        wExit = new WakeupOnCollisionExit(shape, WakeupOnCollisionEntry.USE_GEOMETRY);
>        wakeupOn(wEnter);
>    }
>
>    public void processStimulus(Enumeration criteria) {
>        inCollision = !inCollision;
>
>
>        if (inCollision) {
>            System.out.println("on collision entry:" + shape);
>           //shapeAppearance.setColoringAttributes(highlight);
>
>
>
>           Object objC = shape.getUserData();
>           System.out.println("prtinting object: " + objC);
>           System.out.println("name: " + (((nodeinfo)objC).getname()));
>           System.out.println("bond limit" + (((nodeinfo)objC).getlimit()));
>---->      // sgp = wEnter.getTriggeringPath();
>           System.out.println("prtinting trgpath: " + sgp);
>---->>   //node = sgp.getObject();
>            //Object objC1 = node.getUserData();
>           //System.out.println("name: " + (((nodeinfo)objC1).getname()));
>           //System.out.println("bond limit" + (((nodeinfo)objC1).getlimit()));
>          wakeupOn(wExit);
>
>        }
>        else {
>            System.out.println("on collision exit:" + shape);
>           //shapeAppearance.setColoringAttributes(shapeColoring);
>            wakeupOn(wEnter);
>        }
>    }
>
>I wanted to get the leaf node (Sahpe3d or geometry primitive) that caused the 
>collision of
some node in my universe.
>
>The getTrigerringpath method of the Wakeuponcollision entry a null object. Why is 
>this?
But  my print statement tells me that a collision happened...
>
>
>Thanks!!
>
>Bambam
>
>__________________________________
>www.edsamail.com
>
>===========================================================================
>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