Problem adding wheel inertia vehicle simulation

edouard
Posts: 8
Joined: Fri Sep 25, 2009 2:08 pm

Problem adding wheel inertia vehicle simulation

Post by edouard »

Hi,

It's my first post so nice to meet you all. I'm currently making a game with bullet engine and it's going well, but I'm having some difficulties trying to improve the vehicle simulation. What I want to do is take into account the inertia of the wheel (because it's possible to change the size of the wheels in our game). To do that I simulate the angular velocity for every wheel and then calculate the slip ratio.

here is how I do it for the angular speed

Code: Select all

pWheelInfo->m_AngVel += (rollingFriction * pWheelInfo->m_wheelsRadius * timeStep) / pWheelInfo->m_Inertia;

I only calculate the angular speed when there is an external force apllied to the wheel (engine or brake) if there is no force applied the angular speed equals to

Code: Select all

pWheelInfo->m_AngVel = m_currentSpeedMbyS  / pWheelInfo->m_wheelsRadius;
the slip ratio

Code: Select all

m_slipRatio = (pWheelInfo->m_AngVel*pWheelInfo->m_wheelsRadius - (m_currentSpeedMbyS))/m_currentSpeedMbyS;
the slip ratio affect the amount of torque that the traction force applies to the wheel. My problem is that I always get an inferior simulated speed then my m_currentSpeedMbyS.

I don't know if it's the right way to take into account the inertia of the wheel, maybe there is an easier one to do this, but right now I'm kind of stock. If someone is interested in the physics, I took all my info here


thank you
Edouard