unclepauly
10-10-2008 20:11:32
heres my code to create and attach wheels to my car:
i found this code searching the forum. it seems to be what people are using.
however the code above does not use or reference an nxs file, which is what would be used to scale a physx body. for example, i am using a 3dStudio model for my car which was too big, so i used flour to convert to nxs, and to scale it 3 3 3, and then my code is:
so how to do the same, but for the createFourWheelSet method ?
thank you.
NxOgre::WheelParams wheelP;
wheelP.setToDefault();
wheelP.mMass = 150.0f;
wheelP.mLocalPose.t.set(0, 0, 0);
//wheelP.mDensity = 100.0f;
wheelP.mSuspension.spring = 2715.0f;
wheelP.mSuspension.damper = 1500;
wheelP.mSuspension.targetValue = 0.0f;
wheelP.mSuspensionTravel = 0.3f;
NxOgre::WheelSet* wheelSet = NxOgre::WheelSet::createFourWheelSet(3.0f, NxOgre::float3(3, 3, 5),
NxOgre::float3(-3, 3, -5), nxbodyImpreza, wheelP, "model: gt_wheel.mesh, mode: interpolate, scale: 0.3 0.3 0.3");
m_wheelSet->setAs( NxOgre::WheelSet::TL_Front );
nxbodyImpreza->wakeUp( 1e10 );
nxbodyImpreza->setSleepEnergyThreshold( 0.0 );
i found this code searching the forum. it seems to be what people are using.
however the code above does not use or reference an nxs file, which is what would be used to scale a physx body. for example, i am using a 3dStudio model for my car which was too big, so i used flour to convert to nxs, and to scale it 3 3 3, and then my code is:
NxOgre::Resources::ResourceSystem::getSingleton()->addMeshAs("file://D:\\GAME_STUFF\\FYP\\theGame\\media\\models\\impreza.nxs", "impreza");
NxOgre::CompoundShape* shapeImpreza = new NxOgre::CompoundShape();
shapeImpreza->add(new NxOgre::TriangleMesh(NxOgre::Resources::ResourceSystem::getSingleton()->getMesh("impreza")));
NxOgre::Body* nxbodyImpreza = mNxScene->createBody("NxOgreBody_impreza", shapeImpreza, Ogre::Vector3(208, 10, 363), "model: impreza.mesh, scale: 0.3 0.3 0.3", "mass: 10");
so how to do the same, but for the createFourWheelSet method ?
thank you.