I have create a simple vehicle in 3Ds Max and trying to adjust the wheels position in bullet physics.
I'm able to grab each wheel position by getting each wheel transformation matrix.
Though I'm not getting the wheels position same as the position in 3Ds Max, How can I adjust the wheels position to be exactly as in 3Ds Max model?.
The model consist of (chassis mesh, wheel1 mesh, wheel2 mesh, wheel3 mesh, wheel4 mesh), all in a single .x file.
D3DXMATRIX matWorld;
btVector3 connectionPointCS0;
bool isFrontWheel = true;
// WHEEL 1
matWorld = wheel[0]->TransformationMatrix;
connectionPointCS0 = btVector3(matWorld._41, matWorld._42, matWorld._43);
m_vehicle->addWheel(connectionPointCS0,wheelDirectionCS0,wheelAxleCS,suspensionRestLength,wheelRadius,m_tuning,isFrontWheel);
// WHEEL 2
matWorld = wheel[1]->TransformationMatrix;
connectionPointCS0 = btVector3(matWorld._41, matWorld._42, matWorld._43);
m_vehicle->addWheel(connectionPointCS0,wheelDirectionCS0,wheelAxleCS,suspensionRestLength,wheelRadius,m_tuning,isFrontWheel);
isFrontWheel = false;
// WHEEL 3
matWorld = wheel[2]->TransformationMatrix;
connectionPointCS0 = btVector3(matWorld._41, matWorld._42, matWorld._43);
m_vehicle->addWheel(connectionPointCS0,wheelDirectionCS0,wheelAxleCS,suspensionRestLength,wheelRadius,m_tuning,isFrontWheel);
// WHEEL 4
matWorld = wheel[3]->TransformationMatrix;
connectionPointCS0 = btVector3(matWorld._41, matWorld._42, matWorld._43);
m_vehicle->addWheel(connectionPointCS0,wheelDirectionCS0,wheelAxleCS,suspensionRestLength,wheelRadius,m_tuning,isFrontWheel);
Screenshot (BTW, In this screenshot, the vehicle didn't hit the ground yet):
[attachment=16392:vehicle1.png]