Samuel and Peter,

       Looks like a logic bug in the test program. You are detaching
the parent of your armingNode.

       pLocale
          |
       pBGroup  <--- detach this node.
          |
       pTGroup  <--- Collision armingNode.
          |
        pBox

- Chien.


Peter Antoniac wrote:
csec> Chien Yang,
csec> Here is the code. It mostly comes from the code of bug 4910683
csec> submitted by Peter Antoniac(Thanks goes to him:-) Until I carefully
csec> read through this piece of code have I realized we are having the
csec> same problem, forgive me, anyway, I am a newcomer to j3d.....), What
csec> I have changed is in line 80:
csec> The orginal code is:
csec> pCHandle=new CollisionHandler(pBox);
csec> I change this to:
csec> pCHandle=new CollisionHandler(pTGroup_1);

Yes. Based on my analysis (unfortunately I don't have access to the Java3D
source code) the problem is caused by the separation between the rendering
thread and the collision thread. Because of this separation when you add a
node with collision it might be that the node shows well (the rendering is
done) but the behaviour node operation is not yet installed (and hence the
matrix is not updated). Probably the workout is to synchronize better
between the two threads (if my assumption is correct).

My proposed workaround was to place a big delay between the adding and
removing of the node/branch/etc. In this way you assure that the behaviour
node is installed correctly and you don't get the NullPointer exception...
My comments there were: "CUSTOMER SUBMITTED WORKAROUND : One method that
used to work was to introduce a big wait (10000) before removing the branch
group. It used to work under Linux OS but it doesn't work anymore under
Windows OS. (Incident Review ID: 186599)"

Still, I am not sure if this is the same problem as Liu encounter...but the
bug is quite old and annoying and some votes there might get Java people on
it faster. Here is the link:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4910683

Cheers,
Peter
.----------------------------------------------------------------
| Peter Antoniac, Assistant Professor
| University of Oulu, Dept. of Information Processing Science
| P.O.Box 3000, FIN-90014 Oulu, Finland
| http://marisil.org/peter

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