Skip to content

Panic when removing rigid body in a multi body #908

@newDINO

Description

@newDINO

Scenario:
A chain of rigid bodies attached to a fixed body using multi body joint. Another rigid body placed on top of the fixed body (Won't crash if this body is not added). Crash happens when removing the last body connected to the fixed body.

Backtrace:

thread 'main' (650592) panicked at crates/rapier3d/../../src/dynamics/solver/contact_constraint/generic_contact_constraint.rs:63:35:
No element at index
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::option::expect_failed
   3: rapier3d::dynamics::solver::contact_constraint::generic_contact_constraint::GenericContactConstraintBuilder::generate
   4: rapier3d::dynamics::solver::contact_constraint::contact_constraints_set::ContactConstraintsSet::init
   5: rapier3d::dynamics::solver::island_solver::IslandSolver::init_and_solve
   6: rapier3d::pipeline::physics_pipeline::PhysicsPipeline::step
   7: rapier_testbed3d::harness::Harness::step_with_graphics
   8: rapier_testbed3d::testbed::update_testbed
   9: <bevy_ecs::system::function_system::FunctionSystem<Marker,F> as bevy_ecs::system::system::System>::run_unsafe

Example for reproduction: newDINO/rapier@7d53edd

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