Identify collision types: "crash", "friction&

ulfben

18-04-2008 12:07:24

Hi!

I'm handling the sound for our 3D physics game (Ogre, OgreNewt, FMOD etc...) and am having troubles figuring out what "type" of collision is occuring. We need to play crashing sounds on collisions, friction sounds when things are sliding, something different for low-impact "tumbling" (eg: a box settling from standing on edge) and so on and so forth.

(Just to clarify: I have not been involved in writing the engine itself and only got rudimentary knowledge of OgreNewt.) I'm working within three callbacks - userBegin, userProcess and userEnd. Within these I can access stuff like getContactForce, getContactNormalSpeed, the two OgreNewt-bodies involved and their userdata etc.

My naïve implementation ignores anything with a contactNormalSpeed < 0.1 (eg: weighted bodies standing on top of eachother, unstable piles of boxes etc). Then I just check contactForce and if it's below a threshold I treat it as a friction and not a crash.

But this is stupid. A lot of clearly visible collisions are never played. Especially when boxes tumble and turn, falling off eachother and smashing against the floor seems to yield very low forces (or normal speeds), yet looks as though they should be quite "noisy".

Please; suggestions or sources or ideas - anything to improve my ways would be most welcome. :)