Skip to content

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

Open
@taslater

Description

@taslater

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    2DThe issue is specifically about the 2D version of Rapier.3DThe issue is specifically about the 3D version of Rapier.C-BugSomething isn't workingD-DifficultP-Low

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions