From 893a3900d953c736a2b6d2d0fd7fc8fe708a16ce Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Sun, 15 Dec 2013 20:55:51 -0800 Subject: [PATCH] added palm collision sounds --- interface/src/avatar/Hand.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/interface/src/avatar/Hand.cpp b/interface/src/avatar/Hand.cpp index 164f7e9791..aec55d1579 100755 --- a/interface/src/avatar/Hand.cpp +++ b/interface/src/avatar/Hand.cpp @@ -302,6 +302,15 @@ void Hand::updateCollisions() { glm::vec3 otherPalmPosition = otherPalm.getPosition(); if (glm::length(otherPalmPosition - myPalmPosition) < palmCollisionDistance) { palm.setIsCollidingWithPalm(true); + const float PALM_COLLIDE_VOLUME = 1.f; + const float PALM_COLLIDE_FREQUENCY = 150.f; + const float PALM_COLLIDE_DURATION_MAX = 2.f; + const float PALM_COLLIDE_DECAY_PER_SAMPLE = 0.005f; + Application::getInstance()->getAudio()->startDrumSound(PALM_COLLIDE_VOLUME, + PALM_COLLIDE_FREQUENCY, + PALM_COLLIDE_DURATION_MAX, + PALM_COLLIDE_DECAY_PER_SAMPLE); + } }