diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index fc4a4febb3..dc0a009ef7 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -547,8 +547,12 @@ void MyAvatar::updateJointFromController(controller::Action poseKey, ThreadSafeV void MyAvatar::updateSensorToWorldMatrix() { // update the sensor mat so that the body position will end up in the desired // position when driven from the head. - glm::mat4 desiredMat = createMatFromQuatAndPos(getOrientation(), getPosition()); - _sensorToWorldMatrix = desiredMat * glm::inverse(_bodySensorMatrix); + glm::mat4 bodyToWorld = createMatFromQuatAndPos(getOrientation(), getPosition()); + setSensorToWorldMatrix(bodyToWorld * glm::inverse(_bodySensorMatrix)); +} + +void MyAvatar::setSensorToWorldMatrix(const glm::mat4& sensorToWorld) { + _sensorToWorldMatrix = sensorToWorld; lateUpdatePalms(); diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 3a838505d1..65d0de3801 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -126,6 +126,8 @@ public: // This is so the correct camera can be used for rendering. void updateSensorToWorldMatrix(); + void setSensorToWorldMatrix(const glm::mat4& sensorToWorld); + void setRealWorldFieldOfView(float realWorldFov) { _realWorldFieldOfView.set(realWorldFov); } Q_INVOKABLE glm::vec3 getDefaultEyePosition() const;