Physics · interface
ControllerOptions
Explained in Your first game, Rigid bodies.
interface ControllerOptionsimport type { ControllerOptions } from '@driftengine/physics';Properties
| Name | Type | Description |
|---|---|---|
radiusoptional | number | |
halfHeightoptional | number | Half the cylindrical section, so total height is 2 * (halfHeight + radius). |
stepHeightoptional | number | How high a lip may be and still be walked over. |
slopeCosoptional | number | Cosine of the steepest walkable slope. Above it the character slides. |
maxSpeedoptional | number | |
accelerationoptional | number | |
decelerationoptional | number | |
airControloptional | number | |
jumpSpeedoptional | number | |
jumpCutoffoptional | number | Upward velocity is cut to this fraction when the jump is released early. |
gravityoptional | number | |
coyoteTicksoptional | number | Ticks after leaving the ground during which a jump still counts. |
jumpBufferTicksoptional | number | Ticks a jump press is remembered for, so pressing just before landing still fires. |
slideBoostoptional | number | Extra downhill acceleration while sliding on too steep a surface. |
pushStrengthoptional | number | Impulse scale applied to dynamic bodies the character walks into. |
filteroptional | QueryFilter | |
groundoptional | GroundProbe | A surface to stand on beside the bodies, where the world has one.MoreConsulted 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. |