ODE collision control

Hello hello,

I used the ODE Body and ODE Sphere nodes in conjunction with the World node to create an effect similar to collision control. In our patch, all spheres fly at random and bounce everytime one sphere hits another. That’s probably explained badly, but the attached file should show what I mean.

What I would like to do is manipulate the spheres everytime a collision happens. So I need to get notified whenever such an event takes place. Is it possible to get a signal when two objects collide with each other and react on that? I would need the position coordinates for each object that collided in a spread (I suppose).

Thanks in advance. :)

i dont know a good way to do that with the ode nodes, maybe you can combine them with some differential nodes and try to detect the changes in movement. but because you want to control the positions, this is not easy …

but if you only use spheres (and not too many of them), there is a simple way to detect collisions by calculating the distance of the centers. for more information about vector operations go to 3d Vector Mathematics

download kalles Line (DX9) to see the connections between the spheres:
kalle - Modules\DX9

Wow, thousand thanks! Your example is very illustrating and helps a lot. As I can see, you built your own collision control mechanism. Getting at the colliding object’s properties was exactly what I needed, from there on I can proceed to apply the desired manipulations. And thanks for the pointer to the 3d maths page, but I fear that’s slightly over my head right now. Guess I need to delve deeper into it. :)