CMCharacter Modules 0.1.0

Clip Slide Solver

Kind: Solver · Add Component: Character Modules > Collision > Clip Slide Solver

Slides the character along walls without stepping up. For characters that should not climb stairs on their own.

Moves the shape and slides it along whatever it hits, with no stepping up. For characters that must not climb stairs on their own, or as the plain base the stepping solver builds on.

Inspector
▼Clip Slide Solver⋮
CharacterCharacter (Character Motor)
Max Iterations6
Contact Gap0.002
Steep As WallsOn ▾
The Clip Slide Solver component in the Inspector, with its defaults.
Origin. Quake's PM_SlideMove and ClipVelocity (1996): remove the part of the velocity that goes into a surface.

How it works

Collide and slide. Sweep the hull along what is left of the move. At a contact, stop short of the surface by a small gap measured along the surface's normal, so the gap is the same at any angle of approach. Then continue with the rest of the move, changed as little as possible so that it no longer points into any surface touched so far. Surfaces still touched at the end of a step are remembered for the next one, so a character resting in a crease stays put instead of bouncing between its two sides.

Specification: decision D25 in Documentation~/design-decisions.md. Sources: Fauerby, "Improved Collision Detection and Response" (2003), and the displacement form of collide-and-slide common to kinematic controllers.

This solver never climbs: a 10 cm ledge blocks it like a wall. Use the Step Slide Solver to walk up stairs.

While walking, a steep contact is a wall, unless it is the edge of a walkable surface no higher than RollOverHeight above the feet: then a round hull rolls over it, as a ball rolls up stairs whose treads are shorter than it is wide. Edges are told from steep faces by looking just past the contact onto the surface that holds it (the corner rule, D15).

Properties

PropertyDescriptionRangeDefault
CharacterThe character this module belongs to. Drag its Character Motor here.None
Max IterationsHow many times one move may hit something and carry on along it.1 to 126
Contact GapGap left between the hull and a surface it stops at, metres.0 or more0.002
Steep As WallsWhile walking, treat surfaces too steep to stand on as vertical walls, so the character never rides up them. Off: a capsule rolls up low lips and steep corners.On

Additional resources