本文整理汇总了C++中GMatrix::Parity方法的典型用法代码示例。如果您正苦于以下问题:C++ GMatrix::Parity方法的具体用法?C++ GMatrix::Parity怎么用?C++ GMatrix::Parity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GMatrix
的用法示例。
在下文中一共展示了GMatrix::Parity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPosRotScale
/**
* @brief
* Returns position, rotation and scale from a matrix
*/
void PLTools::GetPosRotScale(const GMatrix &mTransform, Point3 &vPos, Quat &qRot, Point3 &vScale, bool bFlip)
{
// Get the position
vPos = mTransform.Translation();
// Get the rotation of the node as quaternion
qRot = mTransform.Rotation();
// Flip 180 degree around the y-axis? (true for camera and spot lights)
if (bFlip) {
Quat qRotationOffset;
// We have to add a rotation about the x-axis of -90 degree... is this a IGame transform bug or something other odd??
float fAngles[] = {static_cast<float>(HALFPI), 0.0f, 0.0f};
EulerToQuat(fAngles, qRotationOffset);
qRot = qRotationOffset*qRot;
// We have to 'invert the z-axis', this is no PixelLight bug or so, we decided to do so to make things more universal
fAngles[0] = 0.0f;
fAngles[2] = static_cast<float>(PI);
EulerToQuat(fAngles, qRotationOffset);
qRot = qRotationOffset*qRot;
}
// Look out! We REALLY need to take the parity of the transform matrix into account!
vScale = mTransform.Scaling()*static_cast<float>(mTransform.Parity());
}