wheel angular velocity?

RJNelson68
Posts: 73
Joined: Tue Oct 06, 2009 3:19 pm

wheel angular velocity?

Post by RJNelson68 »

Is there some way to get the angular velocity of a wheel for a btRaycastVehicle? I have tried using the wheel transform and accessing column one for the roation, but it doesn't seem to work.
kester
Posts: 27
Joined: Mon Dec 01, 2008 5:08 am

Re: wheel angular velocity?

Post by kester »

Not easily - btWheelInfo::m_deltaRotation is the closest you'll get.

m_deltaRotation is the change in wheel rotation per frame - multiply by the physics step rate should be close enough.
RJNelson68
Posts: 73
Joined: Tue Oct 06, 2009 3:19 pm

Re: wheel angular velocity?

Post by RJNelson68 »

Well actually m_rotation seems to be exactly what I need at a negative value. However, it never slows back down due to to drag or brakes.
RJNelson68
Posts: 73
Joined: Tue Oct 06, 2009 3:19 pm

Re: wheel angular velocity?

Post by RJNelson68 »

Is the fact that the m_rotation value never deaccelerates nornal, or is it something I have failed to adjust?
kester
Posts: 27
Joined: Mon Dec 01, 2008 5:08 am

Re: wheel angular velocity?

Post by kester »

Yes, that's normal - m_rotation is the absolute rotation of the wheel. It is the number of radians the wheel has rotated through, or the number of revolutions the wheel has rotated through / (2 * pi)

m_deltaRotation is the change in m_rotation this frame, which should be angular velocity = m_deltaRotation / timeStep