Skip to content

five-on-it / packages/ai/src/awareness / sightOf

Function: sightOf() ​

sightOf(sim, eye, target, bodies?): number

Defined in: packages/ai/src/awareness.ts:152

How well a watcher sees a character, 0 (not at all) to 1: a target behind tall cover is never seen; behind low cover, crouched, only within the crouch share of the range (the range shortened by the dark and the weather where the target stands, visibility.ts); else within the range and the cone, with a clear ray to its centre (its car's when seated), seen fully near and less far off. Living targets only, unless bodies (a guard looking for the fallen).

Parameters ​

sim ​

SimWorld

eye ​

Eye

target ​

number

bodies? ​

boolean = false

Returns ​

number