Skip to content

How to better handle large-scale simulations with huge numeric values #353

@ShineLuLu

Description

@ShineLuLu

Hi, I'm new to Rapier and really appreciate the great work on this physics engine. I'm currently using Rapier.js in a frontend project for geospatial applications.
One issue I’ve run into is that the Earth isn’t flat — gravity direction varies across regions. I handled this by updating the gravity vector dynamically, which works fine.
However, another problem is that my data values are typically very large and require high precision. Scaling them down for simulation leads to noticeable precision loss, and I haven’t found a good workaround. I suspect this is because Rapier is optimized for small-scale scenes and uses Float32 internally.
Would it be possible to optionally enable Float64 precision, even at the cost of performance? Or are there recommended approaches for handling large-scale simulations accurately?
Thanks!

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