当前位置: 首页>>代码示例>>C++>>正文


C++ Skeleton::GetJointCount方法代码示例

本文整理汇总了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();
	}
开发者ID:,项目名称:,代码行数:35,代码来源:

示例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;
    }
开发者ID:picoriley,项目名称:CloudyCraft,代码行数:25,代码来源:fbx.cpp

示例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();
        }
    }
}
开发者ID:pretty-wise,项目名称:animation_system,代码行数:24,代码来源:AnimationSystem.cpp


注:本文中的Skeleton::GetJointCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。