dimforge / rapier

2D and 3D physics engines focused on performance.
https://rapier.rs
Apache License 2.0
3.97k stars 248 forks source link

One-way platform support for the KinematicCharacterController #502

Open DevinLeamy opened 1 year ago

DevinLeamy commented 1 year ago

Overview

One-way platforms are not supported for the KinematicCharacterController because it doesn't depend on the "solver" to resolve collisions.

E.g. following the conventional approach and using PhysicsHooks will not work.

impl BevyPhysicsHooks for OneWayPlatformHook {
    fn modify_solver_contacts(&self, context: ContactModificationContextView) {
        context.raw.update_as_oneway_platform(...);
    }
}

For the KinematicCharacterController to support one-way platforms, "it would have to run some checks internally to ignore collisions with normals outside of a particular angle wrt. the up direction."