Пример #1
0
// Fix for Simon in regards to animation mesh's orientation 
void Player::setAnimation(DynamicObject *p)
{

	// makes a child node of parent node 
	Ogre::SceneNode *childNode = mPlayerObject->mSceneNode->createChildSceneNode("child");
	childNode->flipVisibility(true); // makes this entire thing visible since parent node is invisible

	for (Ogre::String name : p->meshNames) {
		Ogre::Entity *newEnt = mSceneManager->createEntity(name);
		//mEntity->setCastShadows(true);
		childNode->attachObject(newEnt);
		childNode->setPosition(0, -125, 0);
		childNode->setOrientation(Ogre::Quaternion(0, 0, 1, -1)); // does the rotation 
		childNode->roll(Ogre::Radian(Ogre::Math::PI)); // fixes it so player's back faces us 
	}
}