mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 09:44:21 +02:00
correct yaw sent to audio-mixer in Audio
This commit is contained in:
parent
1884bfc17e
commit
fbdcd57529
3 changed files with 11 additions and 5 deletions
|
@ -160,7 +160,7 @@ int audioCallback (const void *inputBuffer,
|
|||
*(currentPacketPtr++) = 255;
|
||||
|
||||
// memcpy the corrected render yaw
|
||||
float correctedYaw = fmodf(data->linkedAvatar->getRenderYaw(), 360);
|
||||
float correctedYaw = fmodf(data->linkedAvatar->getAbsoluteHeadYaw(), 360);
|
||||
|
||||
if (correctedYaw > 180) {
|
||||
correctedYaw -= 360;
|
||||
|
|
|
@ -275,13 +275,16 @@ void Avatar::UpdateGyros(float frametime, SerialInterface * serialInterface, glm
|
|||
addLean(-measured_lateral_accel * frametime * HEAD_LEAN_SCALE, -measured_fwd_accel*frametime * HEAD_LEAN_SCALE);
|
||||
}
|
||||
|
||||
float Avatar::getAbsoluteHeadYaw() {
|
||||
return _bodyYaw + _headYaw;
|
||||
}
|
||||
|
||||
void Avatar::addLean(float x, float z) {
|
||||
// Add Body lean as impulse
|
||||
_head.leanSideways += x;
|
||||
_head.leanForward += z;
|
||||
}
|
||||
|
||||
|
||||
void Avatar::setLeanForward(float dist){
|
||||
_head.leanForward = dist;
|
||||
}
|
||||
|
|
|
@ -167,18 +167,21 @@ public:
|
|||
|
||||
void reset();
|
||||
void UpdateGyros(float frametime, SerialInterface * serialInterface, glm::vec3 * gravity);
|
||||
|
||||
void setNoise (float mag) { _head.noise = mag; }
|
||||
void setScale(float s) {_head.scale = s; };
|
||||
void setRenderYaw(float y) {_renderYaw = y;}
|
||||
void setRenderPitch(float p) {_renderPitch = p;}
|
||||
float getRenderYaw() {return _renderYaw;}
|
||||
float getRenderPitch() {return _renderPitch;}
|
||||
void setLeanForward(float dist);
|
||||
void setLeanSideways(float dist);
|
||||
void addLean(float x, float z);
|
||||
float getLastMeasuredHeadYaw() const {return _head.yawRate;}
|
||||
float getBodyYaw() {return _bodyYaw;};
|
||||
void addBodyYaw(float y) {_bodyYaw += y;};
|
||||
|
||||
float getAbsoluteHeadYaw();
|
||||
void setLeanForward(float dist);
|
||||
void setLeanSideways(float dist);
|
||||
void addLean(float x, float z);
|
||||
|
||||
const glm::vec3& getHeadLookatDirection() const { return _orientation.getFront(); };
|
||||
const glm::vec3& getHeadLookatDirectionUp() const { return _orientation.getUp(); };
|
||||
|
|
Loading…
Reference in a new issue