Hi all. When I enable the motor in a wheel joint, GetAngle() is not functioning as expected (looks random?). Once the body is in contact with a loop shape, the motor performs as expected except that GetAngle no longer gives the desired info. To clarify: random when not in contact, and still when rolling!
It's been a little while since my last Box2D dabble, sorry if I'm missing something obvious.
Last I checked, b2WheelJoint doesn't have a GetAngle()
Just in case, remember angles are in radians not degrees too - if you are expecting degrees then that might look random 🙂
That's right, I extract the angle from the body as normal. But it breaks as soon as the motor is enabled. Furthermore it completely locks visual rotation after any collision. Yes I work in radians!
So I was hitting b2_maxRotation hmm nobody spotted that?
It had crossed my mind but I figured if that was the problem then it would not 'look random'.
My bad, was just getting a feel for the values. Max motor was too high, friction was too low. Plus starting in free fall meant that the wheel was just up to max as it hit the ground.
I guess it looked random because it appeared to never work again after the impact, but was actually spinning flat out from just before the impact onwards. Thanks for posting.