eferaga
05-03-2012 12:50:48
Hello, i have the next problem, i've created an animated character and everytime it falls down to infinity and i've seen in all the post and no answer seems to work, but i've seen that normal Critter::Body works, only animatedcharacter falls to infinity, i put here my scene code:
//setup physics
mWorld = NxOgre::World::createWorld();
NxOgre::SceneDescription sceneDesc;
sceneDesc.mGravity = NxOgre::Constants::MEAN_EARTH_GRAVITY;
sceneDesc.mUseHardware=false;
mScene = mWorld->createScene(sceneDesc);
mDefaultMaterial = mScene->getMaterial(0);
mDefaultMaterial->setAll(0.1,0.5,0.5);
mRenderSystem = new Critter::RenderSystem(mScene,mSceneMgr);
//create animated character
Critter::AnimatedCharacterDescription characterDesc;
characterDesc.mShape = NxOgre::SimpleCapsule(3.0f,2.0f);
Critter::Node* sinbadNode = mRenderSystem->createNode();
sinbadNode->createAndAttachEntity("sinbad.mesh");
characterSinbad = mRenderSystem->createAnimatedCharacter(Ogre::Vector3(0,20,0), Ogre::Radian(0), sinbadNode, characterDesc);
//create Ogre head
NxOgre::BoxDescription boxDesc(3);
Critter::BodyDescription bodyDesc;
bodyDesc.mMass=15.0f;
Critter::Body* bHead = mRenderSystem->createBody(boxDesc,NxOgre::Matrix44::IDENTITY,"ogrehead.mesh",bodyDesc);
//create ground
NxOgre::PlaneGeometryDescription groundDesc;
mScene->createSceneGeometry(groundDesc);
//setup physics
mWorld = NxOgre::World::createWorld();
NxOgre::SceneDescription sceneDesc;
sceneDesc.mGravity = NxOgre::Constants::MEAN_EARTH_GRAVITY;
sceneDesc.mUseHardware=false;
mScene = mWorld->createScene(sceneDesc);
mDefaultMaterial = mScene->getMaterial(0);
mDefaultMaterial->setAll(0.1,0.5,0.5);
mRenderSystem = new Critter::RenderSystem(mScene,mSceneMgr);
//create animated character
Critter::AnimatedCharacterDescription characterDesc;
characterDesc.mShape = NxOgre::SimpleCapsule(3.0f,2.0f);
Critter::Node* sinbadNode = mRenderSystem->createNode();
sinbadNode->createAndAttachEntity("sinbad.mesh");
characterSinbad = mRenderSystem->createAnimatedCharacter(Ogre::Vector3(0,20,0), Ogre::Radian(0), sinbadNode, characterDesc);
//create Ogre head
NxOgre::BoxDescription boxDesc(3);
Critter::BodyDescription bodyDesc;
bodyDesc.mMass=15.0f;
Critter::Body* bHead = mRenderSystem->createBody(boxDesc,NxOgre::Matrix44::IDENTITY,"ogrehead.mesh",bodyDesc);
//create ground
NxOgre::PlaneGeometryDescription groundDesc;
mScene->createSceneGeometry(groundDesc);