Page 1 of 1

btRaycastVehicle's btWheelInfo rotation problem

Posted: Sat Aug 28, 2021 11:46 am
by Kedro
I use C++ Bullet Physics. I spawn btRaycastVehicle on the btTriangleMesh. I update the wheel model by using
vehicle->getWheelTransformWS(i).getOpenGLMatrix(mat); matrix. As you can see in the clip below wheels steering turns OK, their positions in World Space are correct but rotations are completely off. btWheelInfo's m_rotation or m_deltaRotation also give me wrong results for example after complete stop there is still some m_rotation.
Also vehicle->getCurrentSpeedKmHour() behaves wrong for me. When I accelerate it gives me negative number but when the throttle is released speed is again positive number. Where should I seek problem?

Re: btRaycastVehicle's btWheelInfo rotation problem

Posted: Sun Sep 12, 2021 12:04 pm
by Kedro
I found an issue and now it works, take a look here:
The problem was that I was not setting vehicle coordinate system. Now when I do with vehicle->setCoordinateSystem(0,1,2); it works perfectly.