Hey. I'm working on a 1st person game demo in J3D for my uni project,
and I have one or two questions you might be able to help me with. As
you can probably tell from the questions, it isn't very advanced yet...
In a simple Behavior I have written to deal with collisions, I am
having difficulties with the SceneGraphPath which is the Triggering
object. the offending code is as follows:
public void initialize()
{
this.wakeupOn( new WakeupOnCollisionEntry( nTarget ) );
}
public void processStimulus( Enumeration enum )
{
// want to find out what the missile has hit here
WakeupOnCollisionEntry w = (WakeupOnCollisionEntry)enum.nextElement();
SceneGraphPath sgp = w.getTriggeringPath();
System.out.println( "sgp: " + sgp );
}
When I run this, I get a NullPointerException when the SceneGraphPath
tries to print. If I print out each Node in the SceneGraphPath, I get
a BranchGroup followed by 4 null Nodes (always 4, whatever caused the
collision). The Locale and final Node (a Shape3D) are OK, but it's the
Nodes inbetween that I need to get at. If I don't do anything with the
SceneGraphPath, the Behavior works fine.
Any ideas what am I doing wrong?
Thanks, Grant
===========================================================================
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".