danharibo
01-03-2008 22:32:04
It seems all of my vehicles like to bounce, this means i can't actually drive them because they're bouncing all the time
And creation of PhysX:
void CVehicle::addWheel(Simufarm::WheelParams& params)
{
NxOgre::WheelParams wp;
wp.setToDefault();
wp.setToNormal();
wp.mass = 50;
wp.suspension_damper = 50;
//wp.suspension_spring = 50;
NxOgre::Wheel* mTempWheel = static_cast<NxOgre::Wheel*>(mPhysBody->addShape(new NxOgre::WheelShape(params.Radius,"Offset: "+Ogre::StringConverter::toString(params.Pos),wp)));
mTempWheel->addMesh(params.Model);
mWheelSet->mWheels.insert(mTempWheel);
//Setup Steering and Driving Wheels
if(params.Powered)
mWheelSet->Drive.insert(mTempWheel);
if(params.Steering)
mWheelSet->Steering.insert(mTempWheel);
}
And creation of PhysX:
void CGame::createPhysicsWorld()
{
mPhysWorld = new NxOgre::World("log: txt");
//PhysX Debugger
mPhysWorld->getPhysXDriver()->createDebuggerConnection();
mPhysScene = mPhysWorld->createScene("SufPhysScene",mSceneMgr,"gravity: yes");
mPhysScene->setGravity(Ogre::Vector3(0,-9,0));
}