// ----------------------------------------------------------------------------------------- void CPepeEngineQuaternion::fromAxes(const CPepeEngineVector3* akAxis) { CPepeEngineMatrix3 kRot; for (size_t iCol = 0; iCol < 3; iCol++) { kRot[0][iCol] = akAxis[iCol].x; kRot[1][iCol] = akAxis[iCol].y; kRot[2][iCol] = akAxis[iCol].z; } fromRotationMatrix(kRot); }
void hduQuaternion::fromRotationMatrix(const hduMatrix& rotMat) { double r[3][3]; r[0][0] = rotMat.get(0,0); r[1][0] = rotMat.get(1,0); r[2][0] = rotMat.get(2,0); r[0][1] = rotMat.get(0,1); r[1][1] = rotMat.get(1,1); r[2][1] = rotMat.get(2,1); r[0][2] = rotMat.get(0,2); r[1][2] = rotMat.get(1,2); r[2][2] = rotMat.get(2,2); fromRotationMatrix(r); }
void CQuaternion::fromAxes (const CVector3& xAxis, const CVector3& yAxis, const CVector3& zAxis) { CMatrix4 m; FMatrix4 &kRot = m.m; kRot[0][0] = xAxis.x; kRot[1][0] = xAxis.y; kRot[2][0] = xAxis.z; kRot[0][1] = yAxis.x; kRot[1][1] = yAxis.y; kRot[2][1] = yAxis.z; kRot[0][2] = zAxis.x; kRot[1][2] = zAxis.y; kRot[2][2] = zAxis.z; fromRotationMatrix(m); }
// ----------------------------------------------------------------------------------------- void CPepeEngineQuaternion::fromAxes(const CPepeEngineVector3& xaxis, const CPepeEngineVector3& yaxis, const CPepeEngineVector3& zaxis) { CPepeEngineMatrix3 kRot; kRot[0][0] = xaxis.x; kRot[1][0] = xaxis.y; kRot[2][0] = xaxis.z; kRot[0][1] = yaxis.x; kRot[1][1] = yaxis.y; kRot[2][1] = yaxis.z; kRot[0][2] = zaxis.x; kRot[1][2] = zaxis.y; kRot[2][2] = zaxis.z; fromRotationMatrix(kRot); }
hduQuaternion::hduQuaternion(const hduMatrix& rotMat) { fromRotationMatrix(rotMat); }
hduQuaternion::hduQuaternion(double R[3][3]) { fromRotationMatrix(R); }