These are chat archives for highfidelity/hifi

14th
Jul 2017
Jeffrey Hiebert
@JeffHiebert_GP_twitter
Jul 14 2017 15:00
I've been looking into bug #21445 and I'm having trouble finding the code that is driving the pitch of the avatar's head to match the camera's pitch. I thought it was Application::updateMyAvatarLookAtPosition(), but something else seems take precedence (or Application::updateMyAvatarLookAtPosition() doesn't do what I thought it does).
Clément Brisset
@Atlante45
Jul 14 2017 16:18
@JeffHiebert_GP_twitter LookAtPosition is where the eyes are pointing.
Let me check for the head.
Look at the end of MyAvatar::updateOrientation(float deltaTime)
   getHead()->setBasePitch(getHead()->getBasePitch() + getDriveKey(PITCH) * _pitchSpeed * deltaTime);

    auto headPose = getHeadControllerPoseInAvatarFrame();
    if (headPose.isValid()) {
        glm::quat localOrientation = headPose.rotation * Quaternions::Y_180;
        // these angles will be in radians
        // ... so they need to be converted to degrees before we do math...
        glm::vec3 euler = glm::eulerAngles(localOrientation) * DEGREES_PER_RADIAN;

        Head* head = getHead();
        head->setBaseYaw(YAW(euler));
        head->setBasePitch(PITCH(euler));
        head->setBaseRoll(ROLL(euler));
    }
}
Jeffrey Hiebert
@JeffHiebert_GP_twitter
Jul 14 2017 16:55
@Atlante45 Ah, thank you.