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