O'Reilly logo

Panda3D 1.6 Game Engine by Dave Mathews

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding sound effects

Our next step is to add some sound effects for the cycles' engines and weapons. Because these are sounds that are being produced by actual objects in our world, we want their volume to be dependent on how far those objects are from the camera. That will give our sound environment a more realistic feel.

Panda3D comes with a utility called Audio3DManager that makes it easy to set this up. Don't let the name confuse you, though; this isn't a new kind of AudioManager. It's actually a wrapper that modifies an existing AudioManager. Using this wrapper, we can tie a sound to an object, define an object that is the "listener", and the volume of the sound will drop as the object it's attached to gets further from the "listener".

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required