Problem with Collision

Hello everybody!

I have a problem with collision in java3D.

I use WakeupOnCollisionEntry. It’s ok if an object collides an other.

But if an object collides with a series of other objects, only the first collision is detected…

I have found a message which explain that impossible :
http://www.mail-archive.com/java3d-interest@java.sun.com/msg18393.html

How can I do to have a good collision with more that two object?

Thank you!

So, I have found this website :
http://java3d.j3d.org/tutorials/collision/index.html

But there aren’t explicit example…

Somebody have use this website to implement collision? Can you show me an example to collide more than two object?

Thank you

I’m pretty new to Java3D myself and I found WakuponCollisionEntry was just way too slow to respond. It actually reports a collision once it has already occured. What you want in most cases is to be able to know beforehand whether a collision is about to occur so you can take the appropriate action immediately once it does occur. For this you need to use something called picking. The tutorial that you have linked to is good for understanding so make sure you understand what picking is all about. Also read the Sun Java3D tutorial on picking. And this is also very good:

http://escience.anu.edu.au/lecture/cg/exercises/ex9/picking.en.html

Check this out for quite a good implementation:

http://www.gamedev360.com/fps370/

Hope this helps.

You can use projected pick rays for simple collision prediction.

For real, modern game quality collision detection, you need to write a WakeOnFrame(0) behavior that has all the collision detection and correction logic.

This is is a non-trivial task. Any really good book on writing 3D apps like FPSs though should have articles on it, as does the Oriely book on game physics.

Hello!

Thank you very much for your answer!

I will test it on monday and I will tell you if have problems.

Thank you!