Remove avatars dependency to octree

This commit is contained in:
Atlante45 2015-01-23 11:58:22 -08:00
parent 4fce5113dd
commit 6d9deffdaa
2 changed files with 3 additions and 3 deletions

View file

@ -5,7 +5,7 @@ setup_hifi_library(Network Script)
include_glm()
link_hifi_libraries(audio shared octree networking gpu model fbx)
link_hifi_libraries(audio shared networking gpu model fbx)
# call macro to include our dependency includes and bubble them up via a property on our target
include_dependency_includes()

View file

@ -13,7 +13,6 @@
#include <FBXReader.h>
#include <GLMHelpers.h>
#include <OctreeConstants.h>
#include "AvatarData.h"
#include "HeadData.h"
@ -44,7 +43,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_FRONT);
const glm::vec3 front = glm::vec3( 0.0f, 0.0f, -1.0f);
glm::vec3 newFront = glm::inverse(bodyOrientation) * (orientation * front);
bodyOrientation = bodyOrientation * glm::angleAxis(atan2f(-newFront.x, -newFront.z), glm::vec3(0.0f, 1.0f, 0.0f));
_owningAvatar->setOrientation(bodyOrientation);