X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FHeroine.cc;h=a70b798e92071e6b34fd495f6b2c2219d6543b3b;hp=e2b69b296198dc03e207b35b427c08ec6b29af1a;hb=7f3984f3f9524f5b6813e01ceb2fe576dadff94e;hpb=99ac607f489023a7aa17bfb046113b0e4a65dab6 diff --git a/src/Heroine.cc b/src/Heroine.cc index e2b69b2..a70b798 100644 --- a/src/Heroine.cc +++ b/src/Heroine.cc @@ -26,6 +26,8 @@ *******************************************************************************/ +#include + #include "Heroine.hh" #include "Log.hh" @@ -34,6 +36,22 @@ Heroine::Heroine() : Character("Heroine") {} +void Heroine::update(Mf::Scalar t, Mf::Scalar dt) +{ + Character::update(t, dt); + + Mf::Vector3 at(0.0, 0.0, 0.0); + const Mf::Vector3 up(0.0, 1.0, 0.0); + + if (mState.velocity[0] < 0.0) at[0] = -1.0; + else at[0] = 1.0; + + Mf::Sound::setListenerPosition(Mf::promote(mState.position)); + Mf::Sound::setListenerVelocity(Mf::promote(mState.velocity)); + Mf::Sound::setListenerOrientation(at, up); +} + + bool Heroine::handleEvent(const Mf::Event& event) { Mf::Scalar force = 40.0;