mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 08:21:24 +02:00
rename fronts to forwards
This commit is contained in:
parent
c2cff55427
commit
31ec9b832f
1 changed files with 2 additions and 2 deletions
|
@ -65,8 +65,8 @@ glm::quat HeadData::getOrientation() const {
|
||||||
void HeadData::setOrientation(const glm::quat& orientation) {
|
void HeadData::setOrientation(const glm::quat& orientation) {
|
||||||
// rotate body about vertical axis
|
// rotate body about vertical axis
|
||||||
glm::quat bodyOrientation = _owningAvatar->getOrientation();
|
glm::quat bodyOrientation = _owningAvatar->getOrientation();
|
||||||
glm::vec3 newFront = glm::inverse(bodyOrientation) * (orientation * IDENTITY_FORWARD);
|
glm::vec3 newForward = glm::inverse(bodyOrientation) * (orientation * IDENTITY_FORWARD);
|
||||||
bodyOrientation = bodyOrientation * glm::angleAxis(atan2f(-newFront.x, -newFront.z), glm::vec3(0.0f, 1.0f, 0.0f));
|
bodyOrientation = bodyOrientation * glm::angleAxis(atan2f(-newForward.x, -newForward.z), glm::vec3(0.0f, 1.0f, 0.0f));
|
||||||
_owningAvatar->setOrientation(bodyOrientation);
|
_owningAvatar->setOrientation(bodyOrientation);
|
||||||
|
|
||||||
// the rest goes to the head
|
// the rest goes to the head
|
||||||
|
|
Loading…
Reference in a new issue