At 10:04 18/08/99 +1000, you wrote:
>Hi,
>
>I have created a WakeupOnCollisionEntry (wEnter) object and want to obtain
>the information of the object which the other object with the wEnter
>attached collided with. I have tried to use getTriggeringPath(), but it
>doesn't give me the name of the object instead its output the type of the
>object.
>
>Is there a way so that I can ask getTriggeringPath() to output the name of
>the object instead of its type?
>
The triggering path gives the node sequence from the root of the graph to
the object collided with Sunny and it does have what you want, you just
have to take it a bit further.

What you actually get back is a SceneGraphPath object.  The final item in
the path is the one you want.  You can get this with the method
getObject(), so

    SceneGraphPath sg = wEnter.getTriggeringPath();
    Node collidedNode = sg.getObject();         //Object causing collision

This is from a collision detector I'm working on at the moment.  This bit
seems to work, even though others don't.

You can cast the node into an appropriate object if you either know what
the object _must_ be or by interrogating it.

Hope this helps.

Tony

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