mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 11:39:41 +02:00
in deriveBodyFromHMDSensor, avoid using invalid head pose
This commit is contained in:
parent
1b719ee654
commit
27669d44a7
1 changed files with 7 additions and 4 deletions
|
@ -2338,10 +2338,13 @@ glm::quat MyAvatar::getWorldBodyOrientation() const {
|
||||||
|
|
||||||
// old school meat hook style
|
// old school meat hook style
|
||||||
glm::mat4 MyAvatar::deriveBodyFromHMDSensor() const {
|
glm::mat4 MyAvatar::deriveBodyFromHMDSensor() const {
|
||||||
|
glm::vec3 headPosition;
|
||||||
// HMD is in sensor space.
|
glm::quat headOrientation;
|
||||||
const glm::vec3 headPosition = getHeadControllerPoseInSensorFrame().translation;
|
auto headPose = getHeadControllerPoseInSensorFrame();
|
||||||
const glm::quat headOrientation = getHeadControllerPoseInSensorFrame().rotation * Quaternions::Y_180;
|
if (headPose.isValid()) {
|
||||||
|
headPosition = getHeadControllerPoseInSensorFrame().translation;
|
||||||
|
headOrientation = getHeadControllerPoseInSensorFrame().rotation * Quaternions::Y_180;
|
||||||
|
}
|
||||||
const glm::quat headOrientationYawOnly = cancelOutRollAndPitch(headOrientation);
|
const glm::quat headOrientationYawOnly = cancelOutRollAndPitch(headOrientation);
|
||||||
|
|
||||||
const Rig& rig = _skeletonModel->getRig();
|
const Rig& rig = _skeletonModel->getRig();
|
||||||
|
|
Loading…
Reference in a new issue