slembcke / Chipmunk2D

A fast and lightweight 2D game physics library.
http://chipmunk2d.net
MIT License
2.18k stars 346 forks source link

Floating point precision not configurable w CMAKE. #166

Open stolk opened 6 years ago

stolk commented 6 years ago

There is no CMAKE toggle that can be used to chose single precision floating point.

Currently, the floating point precision is hard-coded in the header, depending on platform.

RogerLevy commented 5 years ago

I don't think this is true. When I set CP_USE_DOUBLES=0 in the preprocessor definitions in VS it seems to work.

slembcke commented 5 years ago

So there's sort of a bigger issue at play here that I've always wanted to find a better solution to.

I've encountered a number of projects that compile Chipmunk with a particular floating point setting that matches their' project's vector type. Then when they build their project they typedef over the top of cpVect when including the headers. So the binary type matches, though the compiled types don't. I've never really found a satisfactory solution to this.

I'd be open to suggestions.