Migrated gl matrix stack to LLMatrix4a

This commit is contained in:
Shyotl
2014-06-22 03:34:51 -05:00
parent 8f6a578ec0
commit 061178ad82
64 changed files with 1533 additions and 1070 deletions

View File

@@ -38,6 +38,7 @@
#include "v3math.h"
#include "v4coloru.h"
#include "v4math.h"
#include "llmatrix4a.h"
#include "llalignedarray.h"
#include "llstrider.h"
#include "llpointer.h"
@@ -258,6 +259,8 @@ protected:
F32 mSpotExponent;
F32 mSpotCutoff;
};
LL_ALIGN_PREFIX(16)
class LLRender
{
friend class LLTexUnit;
@@ -344,8 +347,17 @@ public:
// Needed when the render context has changed and invalidated the current state
void refreshState(void);
LLMatrix4a genRot(const GLfloat& a, const LLVector4a& axis) const;
LLMatrix4a genRot(const GLfloat& a, const GLfloat& x, const GLfloat& y, const GLfloat& z) const { return genRot(a,LLVector4a(x,y,z)); }
LLMatrix4a genOrtho(const GLfloat& left, const GLfloat& right, const GLfloat& bottom, const GLfloat& top, const GLfloat& znear, const GLfloat& zfar) const;
LLMatrix4a genPersp(const GLfloat& fovy, const GLfloat& aspect, const GLfloat& znear, const GLfloat& zfar) const;
LLMatrix4a genLook(const LLVector3& pos_in, const LLVector3& dir_in, const LLVector3& up_in) const;
const LLMatrix4a& genNDCtoWC() const;
void translatef(const GLfloat& x, const GLfloat& y, const GLfloat& z);
void scalef(const GLfloat& x, const GLfloat& y, const GLfloat& z);
//rotatef requires generation of a transform matrix involving sine/cosine. If rotating by a constant value, use genRot, store the result in a static variable, and pass that var to rotatef.
void rotatef(const LLMatrix4a& rot);
void rotatef(const GLfloat& a, const GLfloat& x, const GLfloat& y, const GLfloat& z);
void ortho(F32 left, F32 right, F32 bottom, F32 top, F32 zNear, F32 zFar);
bool projectf(const LLVector3& object, const LLMatrix4a& modelview, const LLMatrix4a& projection, const LLRect& viewport, LLVector3& windowCoordinate);
@@ -353,14 +365,14 @@ public:
void pushMatrix();
void popMatrix();
void loadMatrix(const GLfloat* m);
void loadMatrix(const LLMatrix4a& mat);
void loadIdentity();
void multMatrix(const GLfloat* m);
void multMatrix(const LLMatrix4a& mat);
void matrixMode(U32 mode);
U32 getMatrixMode();
const glh::matrix4f& getModelviewMatrix();
const glh::matrix4f& getProjectionMatrix();
const LLMatrix4a& getModelviewMatrix();
const LLMatrix4a& getProjectionMatrix();
void syncMatrices();
void syncLightState();
@@ -450,7 +462,7 @@ private:
U32 mMatrixMode;
U32 mMatIdx[NUM_MATRIX_MODES];
U32 mMatHash[NUM_MATRIX_MODES];
glh::matrix4f mMatrix[NUM_MATRIX_MODES][LL_MATRIX_STACK_DEPTH];
LL_ALIGN_16(LLMatrix4a mMatrix[NUM_MATRIX_MODES][LL_MATRIX_STACK_DEPTH]);
U32 mCurMatHash[NUM_MATRIX_MODES];
U32 mLightHash;
LLColor4 mAmbientLightColor;
@@ -481,7 +493,8 @@ private:
LLAlignedArray<LLVector4a, 64> mUIOffset;
LLAlignedArray<LLVector4a, 64> mUIScale;
};
} LL_ALIGN_POSTFIX(16);
extern LLMatrix4a gGLModelView;
extern LLMatrix4a gGLLastModelView;