本文整理汇总了C++中ogre::SkeletonPtr::setBindingPose方法的典型用法代码示例。如果您正苦于以下问题:C++ SkeletonPtr::setBindingPose方法的具体用法?C++ SkeletonPtr::setBindingPose怎么用?C++ SkeletonPtr::setBindingPose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::SkeletonPtr
的用法示例。
在下文中一共展示了SkeletonPtr::setBindingPose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EngineSetup
//.........这里部分代码省略.........
ManualObject->position(1, 1, 1);
ManualObject->triangle(18, 19, 20);
ManualObject->position(1, 0, 0);
ManualObject->position(1, 1, 1);
ManualObject->position(1, 0, 1);
ManualObject->triangle(21, 22, 23);
//face 5
ManualObject->position(0, 1, 0);
ManualObject->position(1, 1, 0);
ManualObject->position(0, 1, 1);
ManualObject->triangle(24, 25, 26);
ManualObject->position(1, 1, 0);
ManualObject->position(1, 1, 1);
ManualObject->position(0, 1, 1);
ManualObject->triangle(27, 28, 29);
//face 6
ManualObject->position(0, 0, 0);
ManualObject->position(0, 1, 1);
ManualObject->position(0, 0, 1);
ManualObject->triangle(30, 31, 32);
ManualObject->position(0, 0, 0);
ManualObject->position(0, 1, 0);
ManualObject->position(0, 1, 1);
ManualObject->triangle(33, 34, 35);
ManualObject->end();
Ogre::MeshPtr MeshPtr = ManualObject->convertToMesh("Animation");
Ogre::SubMesh* sub = MeshPtr->getSubMesh(0);
Ogre::SkeletonPtr Skeleton = Ogre::SkeletonManager::getSingleton().create("Skeleton", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
MeshPtr.getPointer()->_notifySkeleton(Skeleton);
Ogre::Bone *Root1 = NULL;
Ogre::Bone *Child1 = NULL;
Ogre::Bone *Child2 = NULL;
Root1 = Skeleton.getPointer()->createBone("Root");
Root1->setPosition(Ogre::Vector3(0.0, 0.0, 0.0));
Root1->setOrientation(Ogre::Quaternion::IDENTITY);
Child1 = Root1->createChild(1);
Child1->setPosition(Ogre::Vector3(4.0, 0.0, 0.0));
Child1->setOrientation(Ogre::Quaternion::IDENTITY);
Child2 = Root1->createChild(2);
Child2->setPosition(Ogre::Vector3(5.0, 0.0, 0.0));
Child2->setOrientation(Ogre::Quaternion::IDENTITY);
Ogre::VertexBoneAssignment Assignment;
Assignment.boneIndex = 0;
Assignment.vertexIndex = 0;
Assignment.weight = 1.0;
Skeleton->setBindingPose();
sub->addBoneAssignment(Assignment);
Assignment.vertexIndex = 1;
sub->addBoneAssignment(Assignment);
Assignment.vertexIndex = 2;
sub->addBoneAssignment(Assignment);
Ogre::Animation *Animation = MeshPtr->createAnimation("HandAnimation", 100.0);
Ogre::NodeAnimationTrack *Track = Animation->createNodeTrack(0, Root1);
Ogre::TransformKeyFrame *KeyFrame = NULL;
for (float FrameTime = 0.0; FrameTime < 100.0; FrameTime += 0.1)
{
KeyFrame = Track->createNodeKeyFrame(FrameTime);
KeyFrame->setTranslate(Ogre::Vector3(10.0, 0.0, 0.0));
}
Root1->setManuallyControlled(true);
Child1->setManuallyControlled(true);
Child2->setManuallyControlled(true);
MeshPtr->load();
MeshPtr.getPointer()->_notifySkeleton(Skeleton);
// Ogre::SkeletonSerializer skeletonSerializer;
// skeletonSerializer.exportSkeleton(Skeleton.get(), "C:\\Users\\Ilya\\Documents\\Visual Studio 2010\\Projects\\Recipes\\media\\models\\testskeleton.skeleton");
// Ogre::MeshSerializer ser;
// ser.exportMesh(MeshPtr.get(), "C:\\Users\\Ilya\\Documents\\Visual Studio 2010\\Projects\\Recipes\\media\\models\\testskeleton.mesh");
Ogre::Entity *Entity = SceneManager->createEntity("Animation", "Animation"/*"testskeleton.mesh"*/);
Ogre::SceneNode *SceneNode = SceneManager->getRootSceneNode()->createChildSceneNode();
SceneNode->attachObject(Entity);
Entity->setDisplaySkeleton(true);
m_AnimationState = Entity->getAnimationState("HandAnimation");
m_AnimationState->setEnabled(true);
m_AnimationState->setLoop(true);
m_Camera->setPolygonMode(Ogre::PolygonMode::PM_WIREFRAME);
Root->renderOneFrame();
}
开发者ID:southerlies,项目名称:OGRE-3D-1.7-Application-Development-Cookbook-Code,代码行数:101,代码来源:SceletalAnimationView.cpp