IT lexicon › Programming › Shapecast

Shapecast

Programming På svenska → Updated: 2026-10-25

Like a raycast, but it sweeps a whole shape — sphere, capsule or box — along a direction and returns the first hit.

A ray is infinitely thin and misses anything merely almost in the way. A shapecast instead sweeps a volume forward and reports where it first touches something, with hit point, normal and distance. That is exactly what a character controller needs to learn how far its capsule may move before meeting a wall.

Special cases get their own names — spherecast, boxcast, capsulecast — but the mechanic is the same sweep. Under the hood it is a close relative of swept AABB: both compute where a moving shape first touches a stationary one, just with different geometry.

← Back to the lexicon