3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-27 02:15:38 +02:00

rename fronts to forwards

This commit is contained in:
Triplelexx 2017-03-22 18:43:30 +00:00
parent c2cff55427
commit 31ec9b832f

View file

@ -65,8 +65,8 @@ glm::quat HeadData::getOrientation() const {
void HeadData::setOrientation(const glm::quat& orientation) {
// rotate body about vertical axis
glm::quat bodyOrientation = _owningAvatar->getOrientation();
glm::vec3 newFront = glm::inverse(bodyOrientation) * (orientation * IDENTITY_FORWARD);
bodyOrientation = bodyOrientation * glm::angleAxis(atan2f(-newFront.x, -newFront.z), glm::vec3(0.0f, 1.0f, 0.0f));
glm::vec3 newForward = glm::inverse(bodyOrientation) * (orientation * IDENTITY_FORWARD);
bodyOrientation = bodyOrientation * glm::angleAxis(atan2f(-newForward.x, -newForward.z), glm::vec3(0.0f, 1.0f, 0.0f));
_owningAvatar->setOrientation(bodyOrientation);
// the rest goes to the head