# [ODE] Collision Force Feedback - the solution?!

Danny van der Ark dendanny at xs4all.nl
Fri Oct 6 05:19:14 MST 2006

```Hi All,

I know this has been asked several times before but I couldn't find any
concrete solutions to this probem in the archives.

When two rigid bodies collide, I'd like to know 'how much force' is involved
during the time of impact.
Much like you have 'dJointGetFeedbackFORCE' functions for joints, but I need
this for rigid bodies..

With the amount of Force involved in a collision, I would be able to:
1. determine if a sound effect should be played - and at what volume
(pending amount of force)
2. determine if particle effect should be spawned (pending amount of force)
3. decide if one or both bodies should, in some entertaining way, 'sustain
damage' by the impact (amount of damage will be determined by amount of
force!)
4. etc.

Currently the only way I know how, is by getting the linear & angular
velocity of both bodies and using F=M*A to determin the amount of F (force).
But since velocity comes as a vector, I need to do a total 4 square roots to
calculate the magnitude of those vectors - for each collision pair, and
silly as this may sound, those SQR's are killing the performance of my game!
Since in some situations I can have dozens of objects colliding with each
other.

I know little about math's or the internal workings of ode in detail, but I
can imagine that this information could be present in some form or another
within ode's collision detector???!!!??? Or perhaps is there another but
faster way to get the same information? (ie. not using the collision depth).

Any ideas or suggestions welcome!

Danny
ps. Note: I'm using ODE in BlitzBasic3D (not C++) in combination with JV-ODE
(a dll wrapper for Blitz/Ode).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://q12.org/pipermail/ode/attachments/20061006/bedda4d6/attachment.htm
```