Table of Contents

Class CharacterMover

Namespace
Box3D
Assembly
Box3D.NET.dll

The plane solver behind a kinematic character controller.

public static class CharacterMover

Inheritance

Inherited Members

Remarks

These are the two steps that make character movement work: given the planes a capsule is touching, find a translation that satisfies all of them, then clip the velocity so the character does not accumulate speed into a wall.

What sits above them - walk speed, jumping, slope limits, step height - is game design, and is left to you. CharacterControllerSample shows one way to assemble it.

Methods

ClipVelocity(Vector3, ReadOnlySpan<CollisionPlane>)

Projects a velocity onto the planes that resisted the movement.

SolvePlanes(Vector3, Span<CollisionPlane>)

Finds the translation closest to the one requested that satisfies every plane.