dimforge / parry

2D and 3D collision-detection library for Rust.
https://parry.rs
Apache License 2.0
529 stars 93 forks source link

Fixed point support #154

Closed richardhozak closed 5 months ago

richardhozak commented 11 months ago

Hello,

this PR implements new parry crate (parry-i32f32) with fixed point numbers, as a reference fixed point number with 32 bits for integer part and 32 bits for decimal part was used (FixedI32F32) from simba crate.

There was some missing functionality in simba, that was needed and is implemented in separate PR in simba repository here https://github.com/dimforge/simba/pull/48

This PR is separated into few commits with different meanings:

There are still some tests that do not pass, as fixed point is not as accurate as floats, in parry I found undocumented improved_fixed_point_support cfg feature which when enabled fixes some of these tests, so I left it on, but these tests still fail:

Could anyone point me in the right direction so I can fix these tests and what is the preferred solution for f32/f64/FixedI32F32 <-> Integer conversions?