UprightFrame::UprightFrame(const CoordinateFrame& cframe) { Vector3 look = cframe.lookVector(); yaw = G3D::pi() + atan2(look.x, look.z); pitch = asin(look.y); translation = cframe.translation; }
//=========================================== bool SoundSystem::set_listener(const CoordinateFrame& frame, const Vector3& vel_vec) { FMOD_VECTOR pos = vec3_to_fmod(frame.translation); FMOD_VECTOR vel = vec3_to_fmod(vel_vec); FMOD_VECTOR forward = vec3_to_fmod(frame.lookVector()); FMOD_VECTOR up = vec3_to_fmod(frame.upVector()); //cout << "Listener: " << frame.translation.toString() << endl; FMOD_RESULT result = system->set3DListenerAttributes(0, &pos, &vel, &forward, &up); return !error_check(result); }