本文整理汇总了C++中Bone::OffsetTransformMatrix方法的典型用法代码示例。如果您正苦于以下问题:C++ Bone::OffsetTransformMatrix方法的具体用法?C++ Bone::OffsetTransformMatrix怎么用?C++ Bone::OffsetTransformMatrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bone
的用法示例。
在下文中一共展示了Bone::OffsetTransformMatrix方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetInterpolatedPose
void AnimationPlayer::GetInterpolatedPose(float time, SceneNode& sceneNode)
{
XMFLOAT4X4 toParentTransform;
Bone* bone = sceneNode.As<Bone>();
if (bone != nullptr)
{
mCurrentClip->GetInteropolatedTransform(time, *bone, toParentTransform);
}
else
{
toParentTransform = sceneNode.Transform();
}
XMMATRIX toRootTransform = (sceneNode.GetParent() != nullptr ? XMLoadFloat4x4(&toParentTransform) * XMLoadFloat4x4(&(mToRootTransforms.at(sceneNode.GetParent()))) : XMLoadFloat4x4(&toParentTransform));
XMStoreFloat4x4(&(mToRootTransforms[&sceneNode]), toRootTransform);
if (bone != nullptr)
{
XMStoreFloat4x4(&(mFinalTransforms[bone->Index()]), bone->OffsetTransformMatrix() * toRootTransform * XMLoadFloat4x4(&mInverseRootTransform));
}
for (auto& childNode : sceneNode.Children())
{
GetInterpolatedPose(time, *childNode);
}
}
示例2: GetBindPose
void AnimationPlayer::GetBindPose(SceneNode& sceneNode)
{
XMMATRIX toParentTransform = sceneNode.TransformMatrix();
XMMATRIX toRootTransform = (sceneNode.GetParent() != nullptr ? toParentTransform * XMLoadFloat4x4(&(mToRootTransforms.at(sceneNode.GetParent()))) : toParentTransform);
XMStoreFloat4x4(&(mToRootTransforms[&sceneNode]), toRootTransform);
Bone* bone = sceneNode.As<Bone>();
if (bone != nullptr)
{
XMStoreFloat4x4(&(mFinalTransforms[bone->Index()]), bone->OffsetTransformMatrix() * toRootTransform * XMLoadFloat4x4(&mInverseRootTransform));
}
for (auto& childNode : sceneNode.Children())
{
GetBindPose(*childNode);
}
}
示例3: GetBindPoseBottomUp
void AnimationPlayer::GetBindPoseBottomUp(SceneNode& sceneNode)
{
XMMATRIX toRootTransform = sceneNode.TransformMatrix();
SceneNode* parentNode = sceneNode.GetParent();
while (parentNode != nullptr)
{
toRootTransform = toRootTransform * parentNode->TransformMatrix();
parentNode = parentNode->GetParent();
}
Bone* bone = sceneNode.As<Bone>();
if (bone != nullptr)
{
XMStoreFloat4x4(&(mFinalTransforms[bone->Index()]), bone->OffsetTransformMatrix() * toRootTransform * XMLoadFloat4x4(&mInverseRootTransform));
}
for (auto& childNode : sceneNode.Children())
{
GetBindPoseBottomUp(*childNode);
}
}