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;
Code: Select all
m_slipRatio = (pWheelInfo->m_AngVel*pWheelInfo->m_wheelsRadius - (m_currentSpeedMbyS))/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