Menu

#2 Expose "IsFixedRotation()" Accessor on b2Body

open
nobody
None
5
2009-07-30
2009-07-30
Melvyn May
No

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.

Discussion

  • Melvyn May

    Melvyn May - 2009-07-30

    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()".

     
  • Melvyn May

    Melvyn May - 2009-07-30

    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.

     
  • Erin Catto

    Erin Catto - 2009-07-31

    Should be doable. I'll make it more explicit than using SetMassData.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.