Fede89
27-12-2007 18:40:29
hi! I'm new to NxOgre and I have a problem with my character.
First of all i create my world and scene
after that I create 2 body, one for my terrain and another only to see the gravity.
and the I create my character
and in the frame listener I write
so nothing special...
now if i run mu application from MSVC ide all works well, i can move my character and the non static body has gravity.
if i run the application outside the ide the body has gravity but i cannot move my body, and hasn't got gravity as well...
can anyone help me?
First of all i create my world and scene
NxOgre::PhysXDriverParams params;
params.logtype = NxOgre::PhysXDriverParams::LT_TEXT;
params.useFrameListener = true;
World* mWorld = new World(params);
Scene* mScene = mWorld->createScene("Main",mSceneMgr, "gravity: 0 -9.8 0, floor: no");
after that I create 2 body, one for my terrain and another only to see the gravity.
NxOgre::Body *body = mScene->createBody( "chiosco.mesh", new NxOgre::TriangleMeshShape("terrain.mesh"),Vector3(0,0,0), "static: yes" );
NxOgre::Body *body2 = mScene->createBody ( "test.mesh", new NxOgre::ConvexShape( "prova.mesh"),Vector3(0,30,0), "mass: 100" );
and the I create my character
NxOgre::CharacterParams characterParams;
characterParams.setToDefault();
characterParams.mDimensions.set( NxVec3( size.x, size.y, size.z) );
characterParams.mType = NxOgre::CharacterParams::CT_Capsule;
NxOgre::Character*player = mScene->createCharacter("Player",NxOgre::Pose(Vector3(0,0,250),Quaternion::IDENTITY),characterParams);
player->createNode();
Entity* ent = mSceneMgr->createEntity("man","man.mesh");
player->getNode()->attachObject(ent);
player->getNode()->setScale(Vector3(10,10,10));
and in the frame listener I write
if(mKeyboard->isKeyDown(KC_UP))
player->addMovement(NxOgre::Character::DR_Forward);
if(mKeyboard->isKeyDown(KC_DOWN))
player->addMovement(NxOgre::Character::DR_Backward);
if(mKeyboard->isKeyDown(KC_LEFT))
player->addMovement(NxOgre::Character::DR_StepLeft);
if(mKeyboard->isKeyDown(KC_RIGHT))
player->addMovement(NxOgre::Character::DR_StepRight);
so nothing special...
now if i run mu application from MSVC ide all works well, i can move my character and the non static body has gravity.
if i run the application outside the ide the body has gravity but i cannot move my body, and hasn't got gravity as well...
can anyone help me?