Moved IDENTITY_FRONT/UP/RIGHT to GLMHelpers

This commit is contained in:
Atlante45 2015-01-23 13:19:03 -08:00
parent 9e923c453f
commit 4eac6cd410
5 changed files with 8 additions and 7 deletions

View file

@ -48,8 +48,7 @@ glm::quat HeadData::getOrientation() const {
void HeadData::setOrientation(const glm::quat& orientation) {
// rotate body about vertical axis
glm::quat bodyOrientation = _owningAvatar->getOrientation();
const glm::vec3 front = glm::vec3( 0.0f, 0.0f, -1.0f);
glm::vec3 newFront = glm::inverse(bodyOrientation) * (orientation * front);
glm::vec3 newFront = glm::inverse(bodyOrientation) * (orientation * IDENTITY_FRONT);
bodyOrientation = bodyOrientation * glm::angleAxis(atan2f(-newFront.x, -newFront.z), glm::vec3(0.0f, 1.0f, 0.0f));
_owningAvatar->setOrientation(bodyOrientation);

View file

@ -14,6 +14,7 @@
#include <gpu/GPUConfig.h>
#include <DeferredLightingEffect.h>
#include <GLMHelpers.h>
#include <PerfStat.h>
#include "RenderableLightEntityItem.h"

View file

@ -15,11 +15,6 @@
#include <QtGlobal> // for quint64
#include <glm/glm.hpp>
// this is where the coordinate system is represented
const glm::vec3 IDENTITY_RIGHT = glm::vec3( 1.0f, 0.0f, 0.0f);
const glm::vec3 IDENTITY_UP = glm::vec3( 0.0f, 1.0f, 0.0f);
const glm::vec3 IDENTITY_FRONT = glm::vec3( 0.0f, 0.0f,-1.0f);
const quint64 CHANGE_FUDGE = 1000 * 200; // useconds of fudge in determining if we want to resend changed voxels
const int TREE_SCALE = 16384; // ~10 miles.. This is the number of meters of the 0.0 to 1.0 voxel universe

View file

@ -18,6 +18,7 @@
#include <QtCore/QDebug>
#include "GeometryUtil.h"
#include "GLMHelpers.h"
#include "SharedUtil.h"
#include "ViewFrustum.h"
#include "OctreeConstants.h"

View file

@ -21,6 +21,11 @@
#include "SharedUtil.h"
// this is where the coordinate system is represented
const glm::vec3 IDENTITY_RIGHT = glm::vec3( 1.0f, 0.0f, 0.0f);
const glm::vec3 IDENTITY_UP = glm::vec3( 0.0f, 1.0f, 0.0f);
const glm::vec3 IDENTITY_FRONT = glm::vec3( 0.0f, 0.0f,-1.0f);
glm::quat safeMix(const glm::quat& q1, const glm::quat& q2, float alpha);
// These pack/unpack functions are designed to start specific known types in as efficient a manner