scaling the createFourWheelSet

unclepauly

10-10-2008 20:11:32

heres my code to create and attach wheels to my car:


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.

unclepauly

11-10-2008 19:16:55

well no response, so im guessing it cant be done.

for anyone else who needs to scale the wheels created by the createFourWheelSet method, i used a tool found here - http://www.ogre3d.org/wiki/index.php/MeshMagick to scale my ogre mesh first.

whw

24-10-2008 07:32:32

you can try this


carBody=mPhysiX->mNxScene->createBody("car", new NxOgre::Cube(40,10,86), Vector3(707,10,528), "model: F40plstc.mesh", "mass: 500,group:head_two_group");
(static_cast<OgreNodeRenderable*>( carBody->getRenderable()))->setScale(Vector3(0.01,0.01,0.01));