btRaycastVehicle's btWheelInfo rotation problem

Post Reply
Kedro
Posts: 2
Joined: Sat Aug 28, 2021 11:31 am

btRaycastVehicle's btWheelInfo rotation problem

Post by Kedro »

Hello,
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?
https://www.youtube.com/watch?v=QHt8TFLrrik
Kedro
Posts: 2
Joined: Sat Aug 28, 2021 11:31 am

Re: btRaycastVehicle's btWheelInfo rotation problem

Post by Kedro »

I found an issue and now it works, take a look here: https://youtu.be/s4ElFeGeAfM
The problem was that I was not setting vehicle coordinate system. Now when I do with vehicle->setCoordinateSystem(0,1,2); it works perfectly.
Post Reply