erincatto / box2d

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

Possibilty of setting float precision in b2_settings. #741

Closed charlie5 closed 3 months ago

charlie5 commented 1 year ago

First of all, sincere thanks for providing this great project.

I've just started porting box2d to the Ada programming language.

Instead of using 'float', I'm using a 'Real' type, which I define in b2_settings. The C++ equivalent would be something like ...

typedef float Real;

This would allow a user to set the precision for the Real type in 'b2_user_settings', so for increased precision ...

typedef double Real;

I was wondering (a) if you can forsee any problems with this, and (b) would something like this be worth doing in your box2d C++ code ?

Regards.