Gravity Problem

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());
}

betajaen

03-03-2012 13:51:48

You haven't passed your scene_desc into the scene creation method

eferaga

04-03-2012 15:22:09

Thank you very much ^^ that solved my problem :D hehehe i really didnt see that problem and i read like 5 times my code xD!!! lol