Skip to main content

collider_active_collision_types

By default, collision-detection is completely disabled between two colliders when both are attached to non-dynamic bodies. Sometimes, it can be useful to enable collision-detection between, e.g., a collider attached to a kinematic rigid-body and a collider attached to a fixed rigid-body. This can be done by modifying the collider's ActiveCollisionTypes:

<load path='/2d/rust/examples/rs_colliders2.rs' marker='ActiveCollisionTypes1' />
<load path='/2d/rust/examples/rs_colliders2.rs' marker='ActiveCollisionTypes2' />
<load path='/2d/bevy/examples/colliders2.rs' marker='ActiveCollisionTypes1' />
<load path='/2d/bevy/examples/colliders2.rs' marker='ActiveCollisionTypes2' />
<load path='/2d/javascript/src/snippets/colliders.ts' marker='ActiveCollisionTypes1' />
<load path='/2d/javascript/src/snippets/colliders.ts' marker='ActiveCollisionTypes2' />
info

To enable collision-detection between kinematic bodies and fixed bodies (as well as dynamic bodies), set its active collision types to:

ActiveCollisionTypes::default() | ActiveCollisionTypes::KINEMATIC_FIXED
RAPIER.ActiveCollisionTypes.DEFAULT | RAPIER.ActiveCollisionTypes.KINEMATIC_FIXED