This commit is contained in:
Jack Andersen 2017-07-30 19:18:26 -10:00
commit 7e02e40cb2
1 changed files with 15 additions and 0 deletions

View File

@ -5,6 +5,7 @@
#include "zeus/CMatrix3f.hpp"
#include "zeus/CMatrix4f.hpp"
#include "zeus/CVector3f.hpp"
#include "zeus/CUnitVector.hpp"
#include <stdint.h>
#include <stdio.h>
@ -246,6 +247,20 @@ public:
0.f, 0.f, 0.f, 1.f);
}
static zeus::CTransform MakeRotationsBasedOnY(const CUnitVector3f& uVec)
{
uint32_t i;
if (uVec.y < uVec.x || uVec.z < uVec.y || uVec.z < uVec.x)
i = 2;
else
i = 1;
CVector3f v = CVector3f::skZero;
v[i] = 1.f;
CUnitVector3f newUVec(uVec.cross(v));
return {newUVec, uVec, uVec.cross(newUVec), CVector3f::skZero};
}
CMatrix3f basis;
CVector3f origin;
};