Jump to content
  • Advertisement
Sign in to follow this  
FuzzeWuzze

Problem determining when to play sound on collision...

This topic is 2661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So i have a game using XNA and a Physics engine(Jiglibx).

I have a room made out of 5 physics object boxes(floor + walls) and throw a sphere physics around. It bounces off and rolls on the ground.
Which is the problem, because the rolling triggers the collision callback with the box objects and the sound gets played over and over and over again.

Its hard explaining in words what i need, but basically somehow determining when the direction of the object adjusts drastically from bouncing off a wall or off the floor before it starts rolling...

Share this post


Link to post
Share on other sites
Advertisement
just take into account the magnitude of the impact velocity (the velocity along the normal). if it's bigger than a threshold value, play the sound
HTH,
Bow

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!