eferaga
01-03-2012 20:24:19
Hello im using Buggyswires and i have the problem that gravity doesnt seem to work because the bodies stand still in the scene without falling, i've tested adding forces to see if the problem was rendering but the forces seem to work, i'll post here my code for createScene function
void createScene()
{
mWorld = NxOgre::World::createWorld();
NxOgre::SceneDescription sceneDesc;
sceneDesc.mGravity = NxOgre::Constants::MEAN_EARTH_GRAVITY;
sceneDesc.mUseHardware=false;
mScene = mWorld->createScene();
mScene->getMaterial(0)->setAll(0.1,0.5,0.5);
mRenderSystem = new Critter::RenderSystem(mScene,mSceneMgr);
NxOgre::BoxDescription boxDesc(3);
Critter::BodyDescription bodyDesc;
bodyDesc.mMass=15.0f;
Critter::Body* bHead = mRenderSystem->createBody(boxDesc,NxOgre::Matrix44::IDENTITY,"ogrehead.mesh",bodyDesc);
bHead->setGlobalPosition(0,200,0);
bHead->addLocalForce(NxOgre::Vec3(-8000,0,0));
mScene->createSceneGeometry(NxOgre::PlaneGeometryDescription());
}
void createScene()
{
mWorld = NxOgre::World::createWorld();
NxOgre::SceneDescription sceneDesc;
sceneDesc.mGravity = NxOgre::Constants::MEAN_EARTH_GRAVITY;
sceneDesc.mUseHardware=false;
mScene = mWorld->createScene();
mScene->getMaterial(0)->setAll(0.1,0.5,0.5);
mRenderSystem = new Critter::RenderSystem(mScene,mSceneMgr);
NxOgre::BoxDescription boxDesc(3);
Critter::BodyDescription bodyDesc;
bodyDesc.mMass=15.0f;
Critter::Body* bHead = mRenderSystem->createBody(boxDesc,NxOgre::Matrix44::IDENTITY,"ogrehead.mesh",bodyDesc);
bHead->setGlobalPosition(0,200,0);
bHead->addLocalForce(NxOgre::Vec3(-8000,0,0));
mScene->createSceneGeometry(NxOgre::PlaneGeometryDescription());
}