本文整理汇总了C++中Matrix4x4f::SetTranslation方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4x4f::SetTranslation方法的具体用法?C++ Matrix4x4f::SetTranslation怎么用?C++ Matrix4x4f::SetTranslation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix4x4f
的用法示例。
在下文中一共展示了Matrix4x4f::SetTranslation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Matrix4x4f BoneBridgeCAL3D::GetModelSpaceTransform() const
{
Matrix4x4f matrix = Matrix4x4f::Identity();
// update model space position
{
Vec3f kernelPosVec;
const CalVector& calPosVec = mpCalBone->getTranslationAbsolute();
for (int i = 0; i < 3; ++i)
{
kernelPosVec[i] = calPosVec[i];
}
matrix.SetTranslation(kernelPosVec);
}
// update model space orientation
{
Quaternionf kernelRotQuat;
const CalQuaternion& calRotQuat = mpCalBone->getRotationAbsolute();
kernelRotQuat = ConvertCAL3DtoKernel(calRotQuat);
matrix.SetRotate(kernelRotQuat);
}
return matrix;
}
示例2: GetDimensions
Matrix4x4f BoneBridgeCAL3D::CalculateBoneSpaceTransform() const
{
Matrix4x4f boneSpaceTransform = Matrix4x4f::Identity();
// set up bone space geometry transform
{
// transform forward by half the box length
const Vec3f& dimensions = GetDimensions();
boneSpaceTransform.SetTranslation(Vec3f(dimensions[Y] / 2.0f, 0.0f, 0.0f));
// set rotational offset (the inversion of the core bone absolute rotation)
{
CalCoreBone* coreBone = mpCalBone->getCoreBone();
CalQuaternion calRotAbsolute = coreBone->getRotationAbsolute();
calRotAbsolute.invert();
Quaternionf kernelRot = ConvertCAL3DtoKernel(calRotAbsolute);
boneSpaceTransform.SetRotate(kernelRot);
}
}
return boneSpaceTransform;
}