Friction sound

note173
Posts: 16
Joined: Wed Jan 25, 2012 6:32 pm

Friction sound

Post by note173 »

I've managed to do simple contact sound effects (iterating over contact points every simulation tick and taking m_appliedImulse). But how can I implement friction sound (e.g. when vehicle tires slide or a crate being dragged)?
kloplop321
Posts: 55
Joined: Sun Jan 01, 2012 7:37 pm

Re: Friction sound

Post by kloplop321 »

I think the source engine detects a dragging motion, and then periodically checks if its still dragging or not, so its not a continuous detection, but only once every 200ms or so.
marios
Posts: 52
Joined: Mon Jul 19, 2010 3:11 am

Re: Friction sound

Post by marios »

I have implemented basic physical sounds effects (impact, scratching), You can find mini tutorial here http://szamq.wordpress.com/2011/09/18/physical-sound/ The frictional sound method is done in the same way like yours - iterating over contacts, but with different condition
note173
Posts: 16
Joined: Wed Jan 25, 2012 6:32 pm

Re: Friction sound

Post by note173 »

Thank you, it gave me a direction to think on.

And how do you handle rolling objects? They may have opposite velocities, but every contact point will be fixed in objects' local space (if there is no slipping).
marios
Posts: 52
Joined: Mon Jul 19, 2010 3:11 am

Re: Friction sound

Post by marios »

i haven't implement rolling sound jet, but i believe it can be done like other two sounds by adding another condition which compares angular velocity of two objects body->getAngularVelocity(). Like this:

Code: Select all

if(enough impulse and penetration) impact_sound();
else if(contact point distance < small value && linear velocities difference > small value 2)
{
   if(angular velocities difference < some value) rollingSound();
   else slidingSound();
}