Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very large 2d cuboid "ground" destabilizes simulation #629

Open
taslater opened this issue May 7, 2024 · 0 comments
Open

Very large 2d cuboid "ground" destabilizes simulation #629

taslater opened this issue May 7, 2024 · 0 comments
Labels
2D The issue is specifically about the 2D version of Rapier. 3D The issue is specifically about the 3D version of Rapier. C-Bug Something isn't working D-Difficult P-Low

Comments

@taslater
Copy link

taslater commented May 7, 2024

A GROUND_WIDTH greater than or equal to about 1e8 causes the simulation to become unstable. Collisions with this very large "ground" seem to impart a large energy to the other collider, which increases as the "ground" is larger. Other times, the object colliding with the ground falls right through.

const PHYSICS_SCALE: f32 = 1e0;
const GROUND_WIDTH: f32 = 1e6;
const GROUND_HEIGHT: f32 = 10.0;

let ground_collider =
    ColliderBuilder::cuboid(GROUND_WIDTH * PHYSICS_SCALE, GROUND_HEIGHT * PHYSICS_SCALE)
        .translation(vector![GROUND_X * PHYSICS_SCALE, GROUND_Y * PHYSICS_SCALE])
        .restitution(GROUND_RESTITUTION)
        .collision_groups(InteractionGroups::new(0b0001.into(), 0b1111.into()))
        .build();

I'm not sure if this is expected behavior for the collision of objects of very different sizes, but I wanted to raise the issue to attention. I should also mention that the height of the cuboid does not seem to improve the stability of the simulated collisions.

@Vrixyz Vrixyz added C-Bug Something isn't working 2D The issue is specifically about the 2D version of Rapier. 3D The issue is specifically about the 3D version of Rapier. P-Low D-Difficult labels May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2D The issue is specifically about the 2D version of Rapier. 3D The issue is specifically about the 3D version of Rapier. C-Bug Something isn't working D-Difficult P-Low
Projects
None yet
Development

No branches or pull requests

2 participants