Physics · interface

ControllerOptions

Explained in Your first game, Rigid bodies.

interface ControllerOptions
import type { ControllerOptions } from '@driftengine/physics';

Properties

NameTypeDescription
radiusoptionalnumber
halfHeightoptionalnumberHalf the cylindrical section, so total height is 2 * (halfHeight + radius).
stepHeightoptionalnumberHow high a lip may be and still be walked over.
slopeCosoptionalnumberCosine of the steepest walkable slope. Above it the character slides.
maxSpeedoptionalnumber
accelerationoptionalnumber
decelerationoptionalnumber
airControloptionalnumber
jumpSpeedoptionalnumber
jumpCutoffoptionalnumberUpward velocity is cut to this fraction when the jump is released early.
gravityoptionalnumber
coyoteTicksoptionalnumberTicks after leaving the ground during which a jump still counts.
jumpBufferTicksoptionalnumberTicks a jump press is remembered for, so pressing just before landing still fires.
slideBoostoptionalnumberExtra downhill acceleration while sliding on too steep a surface.
pushStrengthoptionalnumberImpulse scale applied to dynamic bodies the character walks into.
filteroptionalQueryFilter
groundoptionalGroundProbeA surface to stand on beside the bodies, where the world has one.
More

Consulted after the bodies and only when they found nothing walkable, so a consumer with both keeps whatever a collider said — a body is a thing that is there, and a surface is a description of where the ground is. Absent means bodies alone, which is every consumer that has not asked.