measureShotDistance
measureShotDistance(
test):number
Metres along the ray to where it enters the capsule or one of its
zones, the nearer, when it does within range; Infinity otherwise. Each
is measured into the sphere round the axis point nearest the ray, which
the shape holds, so it is never short of the shape’s own surface by
more than a glancing ray’s difference. A radius or height left at 0 is
defaultCharacterCapsule’s, as the physics cuts an unsized body. Where the shot hits,
writes the zone the ray meets first into the test’s zone, wherever
along the ray it lies, so a projectile stopped at the body’s front
strikes the zone its line runs on into; null where it misses.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
test |
ShotTest |
Returns
Section titled “Returns”number