本文整理汇总了C++中Skeleton::GetJointCount方法的典型用法代码示例。如果您正苦于以下问题:C++ Skeleton::GetJointCount方法的具体用法?C++ Skeleton::GetJointCount怎么用?C++ Skeleton::GetJointCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skeleton
的用法示例。
在下文中一共展示了Skeleton::GetJointCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Interpolate
void Skeleton::Interpolate(const Skeleton& skeletonA, const Skeleton& skeletonB, float interpolation)
{
#if NAZARA_UTILITY_SAFE
if (!m_impl)
{
NazaraError("Skeleton not created");
return;
}
if (!skeletonA.IsValid())
{
NazaraError("Skeleton A is invalid");
return;
}
if (!skeletonB.IsValid())
{
NazaraError("Skeleton B is invalid");
return;
}
if (skeletonA.GetJointCount() != skeletonB.GetJointCount() || m_impl->joints.size() != skeletonA.GetJointCount())
{
NazaraError("Skeletons must have the same joint count");
return;
}
#endif
Joint* jointsA = &skeletonA.m_impl->joints[0];
Joint* jointsB = &skeletonB.m_impl->joints[0];
for (std::size_t i = 0; i < m_impl->joints.size(); ++i)
m_impl->joints[i].Interpolate(jointsA[i], jointsB[i], interpolation, CoordSys_Local);
InvalidateJoints();
}
示例2: ImportSkeleton
//-----------------------------------------------------------------------------------
static Skeleton* ImportSkeleton(SceneImport* import, MatrixStack4x4& matrixStack, Skeleton* skeleton, int parentJointIndex, FbxSkeleton* fbxSkeleton, std::map<int, FbxNode*>& nodeToJointIndex)
{
Skeleton* returnSkeleton = nullptr;
if (fbxSkeleton->IsSkeletonRoot())
{
//THIS IS NEW SKELETON
returnSkeleton = new Skeleton();
import->skeletons.push_back(returnSkeleton);
}
else
{
returnSkeleton = skeleton;
ASSERT_OR_DIE(returnSkeleton != nullptr, "Return skeleton was null! (This should never happen lol)");
}
Matrix4x4 geotransform = GetGeometricTransform(fbxSkeleton->GetNode());
matrixStack.Push(geotransform);
Matrix4x4 modelSpace = matrixStack.GetTop();
nodeToJointIndex[returnSkeleton->GetJointCount()] = fbxSkeleton->GetNode();
returnSkeleton->AddJoint(fbxSkeleton->GetNode()->GetName(), parentJointIndex, modelSpace);
matrixStack.Pop();
return returnSkeleton;
}
示例3: LocalPoseCalculation
void AnimationSystem::LocalPoseCalculation()
{
// todo: can be easly run in parallel.
for( u32 i = 0; i < m_controllers.Count(); ++i )
{
AnimController& controller = m_controllers[i];
Skeleton* skeleton = controller.GetSkeleton();
AnimHierarchy* hierarchy = controller.GetHierarchy();
for( u16 j = 0; j < skeleton->GetJointCount(); ++j )
{
AnimationClip::JointPose local_pose;
controller.GetJointPose( j, local_pose );
AnimTransformation& node = hierarchy->GetNode(j);
node.SetTranslation( local_pose.translation );
node.SetScale( local_pose.scale );
node.SetRotation( local_pose.rotation );
node.CalculateLocalTransformation();
}
}
}