FogField beta
Class of @v12-engine/client/lite-views
export declare class FogFieldThe fog of war as a field of brightness a cell, softened at its edges and eased in time, written into the renderer's fogOfWar a square at a time: the CPU half of the client's FogRenderer
Members
constructor
constructor(source: () => FogState, texture: FogTarget);Constructs a new instance of the FogField class
at
at(x: number, z: number, what: 'visible' | 'explored'): boolean;Whether a point is seen now, or was seen once, as the fog of war says: all is, where there is no war
brightnessAt
brightnessAt(x: number, z: number): number;Brightness at a point, as currently shown
bytes
get bytes(): Uint8Array;The texture's bytes, a cell each, row by row from z 0: how bright each is drawn
depth
readonly depth: number;The map's depth in cells
dispose
dispose(): void;Lets go of what it read the fog from (the game that ended, whole)
refresh
refresh(): void;Makes the next update work out the whole map again, after the visibility source changed
setBeyond
setBeyond(beyond: FogBeyond | undefined): void;What lies beyond the part of the map play happens in (FogBeyond): as dim as explored ground whatever is seen. None, undefined, for a map that is played all over. Its fade into a colour is the renderer's (beyondShapeOf)
setBrightness
setBrightness(brightness: FogBrightness): void;How bright what was seen once (explored) and what never was (unexplored) are drawn, 0..1
update
update(dt: number): void;Eases the fog's brightness towards the simulation's by dt seconds, and works out and writes the squares that changed
width
readonly width: number;The map's width and depth in cells; the fog's texture is this size
written
written: number;How many squares the last update wrote, and whether it wrote the whole map in one
wroteWhole
wroteWhole: boolean;Whether the last update wrote the whole map in one write