本文整理汇总了C++中ogre::SkeletonInstance::setBindingPose方法的典型用法代码示例。如果您正苦于以下问题:C++ SkeletonInstance::setBindingPose方法的具体用法?C++ SkeletonInstance::setBindingPose怎么用?C++ SkeletonInstance::setBindingPose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::SkeletonInstance
的用法示例。
在下文中一共展示了SkeletonInstance::setBindingPose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create_skeleton
bool LIRenAttachmentEntity::create_skeleton ()
{
Ogre::SkeletonInstance* skeleton = entity->getSkeleton ();
if (skeleton == NULL)
return false;
/* Set the initial bone transformations. */
/* The mesh may not have set these correctly if it depended on bones
in external skeletons. Because of external bones, we need to set
the transformations using the pose skeleton of the object. */
LIRenModelData* model = get_model ();
if (model != NULL && model->rest_pose_buffer != NULL)
{
for (int i = 0 ; i < model->rest_pose_buffer->bones.count ; i++)
{
const LIMdlPoseBufferBone* group = model->rest_pose_buffer->bones.array + i;
if (!group->name)
continue;
LIMatTransform t;
if (!object->get_node_transform (group->name, t))
continue;
Ogre::Bone* bone = skeleton->getBone (i);
bone->setPosition (t.position.x, t.position.y, t.position.z);
bone->setOrientation (t.rotation.w, t.rotation.x, t.rotation.y, t.rotation.z);
}
}
/* Make all bones manually controlled. */
for (int i = 0 ; i < skeleton->getNumBones () ; i++)
{
Ogre::Bone* bone = skeleton->getBone (i);
bone->setManuallyControlled (true);
}
/* Set the binding pose. */
skeleton->setBindingPose ();
return true;
}