1681-engine / index / pickTarget
Function: pickTarget() ​
ts
function pickTarget(
from,
dir,
bodies,
range?,
cone?
): number | null;Defined in: src/input/TargetLock.ts:35
The body a drag in direction dir (any length > 0) picks from from, or null. Scored by how far off the drag's line it stands, with distance as a lighter second weight, so a far body dead ahead beats a near one off to the side.
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
from | Point | undefined |
dir | Point | undefined |
bodies | readonly LockBody[] | undefined |
range | number | LOCK_PICK_RANGE |
cone | number | LOCK_PICK_CONE |
Returns ​
number | null