From 0f248c45409218fec5cfe635ebeaa672641c16a9 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 9 Sep 2016 16:31:36 -0700 Subject: [PATCH] expose MyAvatar::setSensorToWorldMatrix() --- interface/src/avatar/MyAvatar.cpp | 8 ++++++-- interface/src/avatar/MyAvatar.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) 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;