erincatto / box2d

Box2D is a 2D physics engine for games
https://box2d.org
MIT License
8.05k stars 1.51k forks source link

GetUserData() in b2Body should have a const variant #678

Closed mgerhardy closed 3 years ago

mgerhardy commented 3 years ago

Sometimes you only want to operate on a const body ptr in order to check the userdata. Currently it's not possible to maintain const correctness in these situations.

const b2BodyUserData& GetUserData() const;

The same is true for all other GetUserData() methods for fixtures and so on.

mgerhardy commented 3 years ago

Closing this as a duplicate for https://github.com/erincatto/box2d/issues/666