FoliageView beta
Class of @v12-engine/client/lite-views
export declare class FoliageView implements CellLayerViewA layer's grass and bushes as drawn: what a game's code reaches through the layer's part. See the file's comment
Members
constructor
constructor(given: CellLayerContext,
look: FoliageLook);Constructs a new instance of the FoliageView class
chunks
readonly chunks?: FoliageChunks;The grass's chunks: which wait to be laid, where each is, its level by its distance. None where no style draws grass
cost
get cost(): number;Milliseconds its last frame took on the CPU, the laying in it left out
dispose
dispose(): void;Its batches, materials' textures and uniforms let go of
disturb
disturb(x: number, z: number, strength?: number): void;Shakes the bushes at a place, as one moving through them would (strength 1): what the rules tell of one hidden in them (rustle), or a game's code (an explosion, a deer)
drawn
get drawn(): number;How many tufts or models are laid
drawnLook
get drawnLook(): FoliageLookParts;The look it draws now, by its groups: the one it was given, with this screen's changes over it (setScreen)
fireStats
get fireStats(): FoliageFireStats | undefined;What its fire costs and does now (FoliageFireStats): none where it has none
flatten
flatten(cells: readonly number[], amount?: number): void;Lays grass flat at these cells on this screen, 1 flat, 0 standing again at once, read by the shader, nothing laid again. It stands up again as its style's walked.recover says, never for 0
frame
frame(frame: CellLayerFrame): void;Every frame: the wind moves on, the chunks waiting are laid as the budget allows and each is drawn at its level, and the bushes are shaken by who goes into them, the nearest the camera first; it is see-through around the player's own units in it, and rustles now and then as each moves through it. Nothing made that is let go of
frameState
readonly frameState: FoliageFrame;What every material of it is drawn with this frame
groundChanged
groundChanged(cells?: readonly number[]): void;The ground under these cells changed (or all of it): what stands on it laid again at its new heights
lay
lay(changed?: readonly number[]): void;The grass and the bushes laid out again from its cells: after they changed (these, or all), or the ground under them did. A few chunks' worth at once; a whole map's a few chunks a frame, the nearest the camera first
layState
layState(changed?: readonly number[], over?: number, seen?: boolean): void;What happened to the layer's cells changed (foliageStateLayer): their state written into the texture the shader reads, and when what grows back started and how long it takes (over, as the rules said), when what burns caught (not said where it came into sight burning: seen)
look
look: FoliageLook;The look it was given: made with, or taken since (relook)
models
readonly models?: BushModels;The game's models, where a style of it draws them (draw: 'models')
neverSolid
neverSolid: boolean;Every chunk drawn by the shader that may leave pixels out, whatever it holds: for measuring what solidify saves
pending
get pending(): number;Chunks that wait to be laid: none once a laying is done
ready
readonly ready: Promise<void>;Settles once its textures are on the card and what was asked of it before is laid
relook
relook(look: FoliageLook): boolean;Takes another look in place, this screen's changes still over it: the chunks whose copies it changes laid again, and nothing where it changes only what the shader reads (the sway, the shakes, the levels). The values the game names are read again with it. Whether it could: not between grass and models, nor where the models are laid otherwise (a part is made anew for those)
setDetail
setDetail(amount: number): void;How much of its density is drawn, 0 to 1: the graphics settings' tall grass
setScreen
setScreen(screen: ((given: FoliageLookParts) => FoliageLookParts) | undefined): boolean;This screen's own changes over the look it is given, from now on: a function of that look, by its groups, to the look drawn; none for the look as given. Taken in place as relook takes a look: whether it could
shake
readonly shake: BushShake;Where they are shaken now: disturb shakes them from code
showAway
showAway(away: number | undefined): void;Draws it as the camera would from away cells from where it looks, on the line it looks along: which copies are thinned out and at which level each chunk is drawn, to judge the levels without moving the camera. None (undefined) for where the camera is
showState
showState(cells: Uint8Array | undefined, options?: {
changed?: readonly number[];
over?: number;
burns?: (value: number) => number | undefined;
}): void;Shows the cells in a state of the caller's in the place of the rules' (FOLIAGE_STATE), on this screen alone and written nowhere: an editor's preview of how a patch burns, is ruined and grows back. cells a value a cell of the map, row by row; changed the cells that changed since it was last shown (all when left out); over the seconds what turns to growing takes. None (undefined) shows the rules' state again
state
readonly state: FoliageStateTexture;What happened to each cell, as the grass's and the bushes' shaders read it
stateShown
get stateShown(): boolean;Whether a state of the caller's is shown in the place of the rules' (showState)
stats
get stats(): FoliageStats & {
solid: number;
seenThrough: number;
};What it costs now (FoliageStats): its chunks, those drawn at a level (the renderer leaves out those out of the view), its copies, those drawn, what its last laying took and its last frame
styleTable
readonly styleTable: FoliageStyleTable;What each style says that the grass's shader reads as it draws
sunStrength
sunStrength?: number;How strong the sun is for what comes through the tips and shines (the client's light's intensity, 2 at most): the brightest of the sun's colour where left out
tileCells
readonly tileCells?: FoliageTileCells;The cells it is drawn from where it grows from the ground's paint (FoliageLook.on): none where it grows where the layer is painted alone
walk
readonly walk?: FoliageWalk;Where the grass is pushed and laid down by who walks in it on this screen. None for models, which only shake
warmFire
warmFire(): {
effects: {
name: string;
effect: string | FxDef;
}[];
};What its fire plays, made ahead (the warm-up, behind the loading screen): the effects its looks name, as played, the client's warmFire