daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest Nov 8th, 2018 148 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. namespace
  2. {
  3.     // Sound coordinate system, point of view of a player in front of the screen:
  4.     // X = left; Y = up; Z = back (out of the screen)
  5.     const float ListenerZ = 300.f;
  6.     const float Attenuation = 8.f;
  7.     const float MinDistance2D = 200.f;
  8.     const float MinDistance3D = std::sqrt(MinDistance2D*MinDistance2D + ListenerZ * ListenerZ);
  9. }
  10.  
  11.  
  12. GEX::SoundPlayer::SoundPlayer()
  13.     : soundBuffers_()
  14.     , sounds_()
  15. {
  16.  
  17. loadBuffer(SoundEffectID::AlliedGunfire, "Media/Sound/AlliedGunfire.wav");
  18. loadBuffer(SoundEffectID::EnemyGunfire, "Media/Sound/EnemyGunfire.wav");
  19. loadBuffer(SoundEffectID::Explosion1, "Media/Sound/Explosion1.wav");
  20. loadBuffer(SoundEffectID::Explosion2, "Media/Sound/Explosion2.wav");
  21. loadBuffer(SoundEffectID::LaunchMissile, "Media/Sound/LaunchMissile.wav");
  22. loadBuffer(SoundEffectID::CollectPickup, "Media/Sound/CollectPickup.wav");
  23. loadBuffer(SoundEffectID::Button, "Media/Sound/Button.wav");
  24.  
  25. // Listener points towards the screen (default in SFML)
  26. sf::Listener::setDirection(0.f, 0.f, -1.f);
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top