[SOLVED] Tire mesh not loading on vehicle

tuxbook

23-04-2008 07:08:43

I'm using 0.9 and I've created a vehicle with the following code:

mTruck = mScene->createBody("mytruck;truck.mesh",new CubeShape(3,2,4),Vector3(0,2,0), "mass: 1500");


mTruck->setCMassOffsetLocalPosition(Vector3(0,-1,0));

mTruckWS = new WheelSet;

mTruckWS->createFourWheelSet(mTruck, Vector3(-1.5f,-0.4f,2), Vector3(1.5f,-0.4f,-2), 1.0f);

mMotor = new Motor("Motor", mScene, &mTruckWS->Drive);
mTruckWS->attachDriveShaft(mMotor);

mTruckWS->addMeshes("tire.mesh");


The truck mesh loads and appears to be on invisible wheels. The tire mesh is not visible anywhere.

Doing:
mScene->createBody("tire;tire.mesh", new CubeShape(1,1,1), Vector3(0,20,0), "mass: 1");
Works fine and loads the mesh.

Any idea why the tire mesh isn't loading for the vehicle?

tuxbook

23-04-2008 08:21:42

I figured out the problem. Apparently WheelSets don't work off the heap? Anyway, this works:

mTruck = mScene->createBody("truck.mesh", new CubeShape(3,2,4), Vector3(0,4,0), "mass: 1200");
mTruck->setCMassOffsetLocalPosition(Vector3(0,-1,0));

mTruckWS = WheelSet::createFourWheelSet(mTruck, Vector3(-1.5f, -0.4f, 2.0f), Vector3(1.5f,-0.4f,-2.0f), 1);
mMotor = new Motor("Motor", mScene, &mTruckWS.Drive);
mTruckWS.attachDriveShaft(mMotor);
mTruckWS.addMeshes("tire.mesh");


Which is from http://www.ogre3d.org/phpBB2addons/viewtopic.php?p=25047#25047