Skip to content

Floating-point precision error at large-numbered positions #407

@sjl057

Description

@sjl057

At higher positions (that is to say, far from 0, 0), collisions begin to act strangely. I personally found this while working on a game in Godot, and one of the maintainers on Github told me to open an issue here. You can see the original issue here:
appsinacup/godot-rapier-physics#489 (comment)

In it is a video that shows what happens. I initially found it when a tester reported that they don't stop walking into a certain object, and with some testing, I determined that it was position-dependent. The exact distance seems to vary, but the further out it is, the more strange the behavior becomes. Closer to 0, 0, pushing into an object makes it claim the position delta is greater than 0, enough for the is_zero_approx method to return false. At higher distances, unexpected movements occur as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions