arcade2d
Interface

Capsule

physics/rigid-body.types.ts:40

A capsule collider shape — a rectangle capped with a semicircle on each end, oriented vertically. Capsules are the standard collider for characters because their rounded ends slide over edges and steps instead of catching on them. arcade2d's geometry module models Circle, Rectangle, and Polygon but has no capsule primitive, so this small descriptor names one for collider use.

Both measurements are in pixels and define the shape centered on the host's local origin: the total height is halfHeight * 2 + radius * 2.

Properties

readonly #
halfHeight: number

Half the height of the capsule's central rectangle (excluding the rounded caps), in pixels. Must be positive.

readonly #
radius: number

The radius of the rounded caps and the rectangle's width, in pixels. Must be positive.

ESC