本文整理汇总了C++中Matrix4x4f::GetRotate方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4x4f::GetRotate方法的具体用法?C++ Matrix4x4f::GetRotate怎么用?C++ Matrix4x4f::GetRotate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix4x4f
的用法示例。
在下文中一共展示了Matrix4x4f::GetRotate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void BoneBridgeCAL3D::SetModelSpaceTransform(const Matrix4x4f& modelSpaceTransform) const
{
// calculate the transform as relative to the parent bone
Matrix4x4f localModelSpaceTransform = Matrix4x4f::Identity();
{
// for now use absolute model space positioning
localModelSpaceTransform = modelSpaceTransform;
// divide by any existing parent's model space position
if (const Bone* parent = GetParent())
{
//const osg::Matrix parentTransform = ConvertKerneltoOSG(parent->GetModelSpaceTransform());
const Matrix4x4f parentTransform = parent->GetModelSpaceTransform();
// get inverse of parent transform
const Matrix4x4f invParentTransform = parentTransform.Inverse();
localModelSpaceTransform *= invParentTransform;
}
}
// now update the cal3d side from this new model space information
#if WRITE_CAL3D_BONE_TRANSLATION
// update model space position
{
Vec3f kernelPosVec = localModelSpaceTransform.GetTranslation();
CalVector calPosVec;
for (int i = 0; i < 3; ++i)
{
calPosVec[i] = kernelPosVec[i];
}
mpCalBone->setTranslation(calPosVec); // setting the relative position
}
#endif
#if WRITE_CAL3D_BONE_ROTATION
// update model space orientation
{
const Quaternionf& kernelRotQuat = localModelSpaceTransform.GetRotate();
CalQuaternion calRotQuat;
calRotQuat = ConvertKerneltoCAL3D(kernelRotQuat);
mpCalBone->setRotation(calRotQuat); // setting the relative orientation
}
#endif
}