why my robot body fly into sky(with no force)

caifie

14-05-2010 11:29:17

hi!

i'm using ogre1.7+nxogre1.6, when i create a body with bobot.mesh, it will circle and fly into the sky, and then disappeared

1.get the bobot.nxs by using ogrexmltoflower.rb and flour 0.4

ruby ogrexmltoflower.rb convex bobot.mesh.xml <-------------------get the robot.flower
flour --convex robot.flower <------------------------------get the robot.nxs

2. create the body with robot.nxs and robot.mesh

// Plane creation
mScene->createSceneGeometry(NxOgre::PlaneGeometryDescription());

// create a floor mesh resource
Ogre::MeshManager::getSingleton().createPlane("floor", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
Plane(Vector3::UNIT_Y, 0), 1000, 1000, 1,1 , true, 1, 1, 1, Vector3::UNIT_Z);

// create a floor entity, give it a material, and place it at the origin
Ogre::Entity* floor = mSceneMgr->createEntity("Floor", "floor");
floor->setMaterialName("ground-from-nxogre.org");
floor->setCastShadows(false);
mSceneMgr->getRootSceneNode()->attachObject(floor);

NxOgre::MeshManager* meshMan = NxOgre::MeshManager::getSingleton();
NxOgre::ResourceSystem::getSingleton()->openProtocol(new Critter::OgreResourceProtocol());
NxOgre::Mesh* robot = meshMan->load("ogre://Popular/robot.nxs", "robot");
Critter::BodyDescription bodyDescriptionb;
bodyDescriptionb.mMass = 40.0f;
Critter::Body* bodyb=mRenderSystem->createBody(NxOgre::ConvexDescription(robot), Vec3(2,13,7), "robot.mesh", bodyDescriptionb);
bodyb->getSceneNode()->setScale(0.1,0.1,0.1);


when i run this, the robot will circle slowly at first, and then fly into the sky quickly.

but when i test the barrel.mesh to create body, it behaves well and falls down to the floor plan.

NxOgre::Mesh* barrel = meshMan->load("ogre://Popular/barrel.nxs", "barrel");
Critter::BodyDescription bodyDescription2;
bodyDescription2.mMass = 40.0f;
bodyDescription2.mLinearVelocity = Vec3(1,0,0);

for (unsigned int i=0;i < 10;i++)
mRenderSystem->createBody(NxOgre::ConvexDescription(barrel), Vec3(0,45+(i*2),0), "barrel.mesh", bodyDescription2);


anyone kowns this?