Expose "IsFixedRotation()" Accessor on b2Body
Status: Beta
Brought to you by:
erincatto
Currently you can get most information from the b2Body that represents the original options selected via the b2BodyDef but you cannot do this for the "fixedRotation".
Either expose a new "isFixedRotation()" on the body and/or expose a copy of the b2Body private "m_flags" field.
This probably relates to why the flag is not exposed but it doesn't seem difficult to be able to modify whether the body is "fixed rotation" dynamically as long as the mass-data is modified appropriately afterwards e.g. "setMassData()" or "setMassFromShapes()".
Hmm, will:
-------------------------------------------------------
b2MassData massData = body->GetMassData();
massData.I = 0.0f;
body->setMassData( massData );
-------------------------------------------------------
provide a way to dynamically adjust the fixed rotation? I presume this is the angular moment.
Should be doable. I'll make it more explicit than using SetMassData.