Jump to content
  • Advertisement
Sign in to follow this  
Starfox

When to play impact sounds based on physics collisions?

This topic is 2155 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

I'm trying to set up a simple demo where physics-based dominoes tumble and fall. I have an audio clip that I want to play as the impact sound (that plastic-on-plastic sounds you get when dominoes hit each other) and I'm not sure about when to play it. I tried playing it on every collision being reported from Bullet physics engine (ignoring the play commend if the sound is currently playing, obviously) but that doesn't seem to be the way to do it. This might be obvious to someone who did that before but I'd like to hear what's usually done in this case.

Share this post


Link to post
Share on other sites
Advertisement

Maybe the timing of the sound isn't the issue. It seems to me that you'd want to play impact sounds based on the force of impact. You'd probably want several recorded impact sounds for variety and of different sound levels (you'd also want to adjust the volume level dynamically to achieve an entire range of volumes). Play the louder sound effects if the force of impact is strong and quieter sound effects if it's weak.

Share this post


Link to post
Share on other sites


I tried playing it on every collision being reported from Bullet physics engine ... but that doesn't seem to be the way to do it.
And... what problem are you observing with that approach?

Keep in mind that Bullet does not reports collisions. It reports collision manifolds, which are a different thing.

Share this post


Link to post
Share on other sites

 


I tried playing it on every collision being reported from Bullet physics engine ... but that doesn't seem to be the way to do it.
And... what problem are you observing with that approach?

Keep in mind that Bullet does not reports collisions. It reports collision manifolds, which are a different thing.

 

What's the difference between a collision and a collision manifold?

Share this post


Link to post
Share on other sites

You probably have found an answer already by googling so just for future reference.

 

Bullet does not work on collisions. Instead, it works on proximity. When two objects are close enough, it will create an incremental list of contact point pairs called collision manifold.

Those pairs are separated by a certain distance, which is computed when objects are nearby or when they are encroaching. If two objects are touching "exactly" then this distance will be zero (it's a fairly rare case).

So, if you're playing the sound as soon as the manifold is generated, then it sure won't work!

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!