collisions

Hi!!

I´m from Spain, sorry for my english. I´m finishing my studies and I´m making my final project. I´m building an interface for a librarian robot. This interface has a 3d image of a virtual robot maked with java3d. Now I can move the robot but I need more information about the collisions. I´m searching a code example of collisions to know how to use the functions that appear in java 3d. I need to know how to use them, thanks

Xema

Java3D collision dtection cannot be used for simulation of two physica; objects colliding because you do not get the information on the collision until some tiem AFTER the interpenetration has been rendered. It notifies you that a collision has ocurred some tiem in the past, but not necessarily exactly on the frame that collision first occurs.

For this kind of collision detection (sometimes called collision avoidance) you have three choices:
(1) Use pick rays to shoot out ahead of your object in the movement direction, find the maximal distance the objectcan travel before it collides with the environment, and clip your motion to match.

(2) Use the Java bindinsg to ODE to do your collision detection.

(3) Implement a real per-frame game style collision system from the ground up in Java.

#1 is really only suitable for simple “toy” problems but might be enough for you.

#2 is a fair bit of work, requires you use a native library, and adds a lot of memory overhead because ODE is a native lib with JNI bindings and it keeps its own representation of the workld that you have to keep synchronized with the J3D scene graph.

#3 requires you know a fair bit about collision detection algorithms. Shawn Kendall at IMI is currently writing a Java3D integrated physics library. When done it should be the easiest path to this rto of thing but hes still in Alpha on it. (Im using it in a project of mine as an Alpha tester.)

What aspect of physics simulation is planned for the IMI project?

I classify physics engine features very broadly as (in increasing complexity):

  1. collision avoidance
  2. collision detection and response (contrained motion)
  3. resting contact (contrained motion with stacking of objects)
  4. joints (constrainted contact)
  5. foward kinematics
  6. reverse kinematics

For what it’s worth, Genesis FX currently has level 2 partially complete (interparticle collisions and resting contact coming in v1.1).

Mike

sorry,

Then, I can´t use the existent class behavior in java to solve the colisions of the robot with the other items of the library?

You can use the Java3D collision support, but your robot may penetrate other objects. The other option is to use ODE (see the Game Physics forum) or build your own collision detection and response system.

Mike

Hmm Im not sure if, as an Alpha tester, I can sya very much…

I hoep im not rbeakign NDA with thsi… The current library does coliision dection of collision vlumes (currently spheres though other forms are planned) against a scene graph and returns penetration vectors for calculation o responses. Above that its left up to the game because how a game uses the data tends to be pretty game spcific. (I’m jsut pushing objects back to bound motion in JNWN. This combined with a gravity impulse "down"gives me surface walking and wall-limiting of motion.