mirror of https://github.com/AxioDL/zeus.git
CTransform::orthonormalize added
This commit is contained in:
parent
a76d43d5df
commit
b721e09ef5
|
@ -110,12 +110,13 @@ public:
|
|||
return vec[i];
|
||||
}
|
||||
|
||||
inline const CMatrix3f orthonormalized()
|
||||
inline const CMatrix3f orthonormalized() const
|
||||
{
|
||||
CMatrix3f ret;
|
||||
ret.vec[0] = vec[0].normalized();
|
||||
ret.vec[1] = vec[2].normalized();
|
||||
ret.vec[2] = vec[1].normalized();
|
||||
ret[0] = vec[0].normalized();
|
||||
ret[2] = ret[0].cross(vec[1]);
|
||||
ret[2].normalize();
|
||||
ret[1] = ret[2].cross(ret[0]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -214,6 +214,14 @@ public:
|
|||
return ret;
|
||||
}
|
||||
|
||||
inline void orthonormalize()
|
||||
{
|
||||
m_basis[0].normalize();
|
||||
m_basis[2] = m_basis[0].cross(m_basis[1]);
|
||||
m_basis[2].normalize();
|
||||
m_basis[1] = m_basis[2].cross(m_basis[0]);
|
||||
}
|
||||
|
||||
CMatrix3f m_basis;
|
||||
CVector3f m_origin;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue