本文整理汇总了C++中FBoneContainer::GetNumBones方法的典型用法代码示例。如果您正苦于以下问题:C++ FBoneContainer::GetNumBones方法的具体用法?C++ FBoneContainer::GetNumBones怎么用?C++ FBoneContainer::GetNumBones使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FBoneContainer
的用法示例。
在下文中一共展示了FBoneContainer::GetNumBones方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConvertPoseToMeshSpace
void FAnimationRuntime::ConvertPoseToMeshSpace(const TArray<FTransform> & LocalTransforms, TArray<FTransform> & MeshSpaceTransforms, const FBoneContainer& RequiredBones)
{
const int32 NumBones = RequiredBones.GetNumBones();
// right now all this does is to convert to SpaceBases
check( NumBones == LocalTransforms.Num() );
check( NumBones == MeshSpaceTransforms.Num() );
const FTransform* LocalTransformsData = LocalTransforms.GetData();
FTransform* SpaceBasesData = MeshSpaceTransforms.GetData();
const TArray<FBoneIndexType> & RequiredBoneIndexArray = RequiredBones.GetBoneIndicesArray();
// First bone is always root bone, and it doesn't have a parent.
{
check( RequiredBoneIndexArray[0] == 0 );
MeshSpaceTransforms[0] = LocalTransforms[0];
}
const int32 NumRequiredBones = RequiredBoneIndexArray.Num();
for(int32 i=1; i<NumRequiredBones; i++)
{
const int32 BoneIndex = RequiredBoneIndexArray[i];
FPlatformMisc::Prefetch(SpaceBasesData + BoneIndex);
// For all bones below the root, final component-space transform is relative transform * component-space transform of parent.
const int32 ParentIndex = RequiredBones.GetParentBoneIndex(BoneIndex);
FPlatformMisc::Prefetch(SpaceBasesData + ParentIndex);
FTransform::Multiply(SpaceBasesData + BoneIndex, LocalTransformsData + BoneIndex, SpaceBasesData + ParentIndex);
checkSlow( MeshSpaceTransforms[BoneIndex].IsRotationNormalized() );
checkSlow( !MeshSpaceTransforms[BoneIndex].ContainsNaN() );
}
}
示例2: InitializeTransform
void FAnimationRuntime::InitializeTransform(const FBoneContainer& RequiredBones, /*inout*/ FTransformArrayA2 & Atoms)
{
check( Atoms.Num() == RequiredBones.GetNumBones() );
const TArray<FBoneIndexType> & RequiredBoneIndices = RequiredBones.GetBoneIndicesArray();
for (int32 j = 0; j < RequiredBoneIndices.Num(); ++j)
{
const int32 BoneIndex = RequiredBoneIndices[j];
Atoms[BoneIndex].SetIdentity();
}
}