SceneryView beta
Class of @v12-engine/client/lite-views
export declare class SceneryViewThe scenery of a map on this renderer, the client's DoodadView for scenery that stands still: each doodad a copy or merged by chunk, at a level of detail by its distance (see the top of this file)
Members
constructor
constructor(renderer: Renderer, ground: SceneryGround, options: SceneryOptions);Constructs a new instance of the SceneryView class
add
add(doodad: MapDoodad): void;Adds a doodad, or changes the one of its id: drawn on its own at once, merged once it has been still a while
all
get all(): MapDoodad[];Every doodad drawn, a new list
batches
get batches(): ((doodad: MapDoodad) => boolean | undefined) | undefined;
set batches(decide: ((doodad: MapDoodad) => boolean | undefined) | undefined);Whether a doodad is merged, in code, over what is said of its model and of it: true it is (as far as it can be), false it is drawn as a copy, nothing as the rest say. Set it again (or recheck) when what it goes by changes
batching
get batching(): Readonly<Required<SceneryBatchLook>>;
set batching(look: SceneryBatchLook);How scenery is merged now: the game's say over the defaults
clipsOf
clipsOf(model: string): string[];The clips a model has, by their names, once one of its doodads has played one: none until then
dispose
dispose(): void;Takes away its batches, its chunks' geometries, its models and its lights
drawnAs
drawnAs(id: number): 'chunk' | 'copies' | 'own' | undefined;How a doodad is drawn now
frame
frame(): void;Once a frame, before the renderer culls: the levels looked at, what fades stepped, the pictures turned, the batches told
groundChanged
groundChanged(area?: {
x: number;
z: number;
width: number;
depth: number;
}): void;The ground changed (all of it, or a rectangle of cells): what stands there stands on it again
letGo
letGo(id: number): void;A lifted doodad let go: drawn as the rest again, merged once it has been still a while
levels
levels(visit: (thing: {
x: number;
y: number;
z: number;
reach: number;
}, level: number, picture: boolean) => void): void;What is drawn at which level now, for the debug views (detail): each doodad laid out, its foot, how far it reaches, the level its distance picks and whether that is its picture
lift
lift(id: number): boolean;A doodad taken out of its chunk onto a copy of its own for code (an outline round it): never merged until it is let go (letGo). False for one not drawn
load
load(model: string, files?: readonly string[]): Promise<void>;Loads a model's levels' files now, whatever wants them (a cutscene about to show a far city: the client's WorldDetail.load): all its lighter levels' files, or files by their paths, those said to be loaded by code alone (load: 'never') too. Settles once they have loaded (or could not)
madeInPage
madeInPage(file: string): number | undefined;The triangles of a level made in the page (MADE_HERE, where the game says simplify): nothing for one not made
modelOf
modelOf(model: string): DrawnModel | null | undefined;A model as it was read, once it has loaded: its box and its triangles as numbers, which a pick by ray tries (lite/world/picks.ts). Null where its file could not be read; nothing while it is on its way
named
named(name: string): MapDoodad | undefined;The doodad with a name
night
get night(): number;
set night(night: number);How far into the night it is, 0 by day to 1 once the lamps are fully up (the client's nightOf): what a model that glows by the hour glows with (ModelGlow.night)
outline
outline(id: number, style: Outline | undefined): void;Outlines a doodad in a style of the renderer's (renderer.outlines.style), or no longer (undefined): lifted onto a copy of its own while it is (lift), every copy it is drawn with in the view marked as one thing by its id
pictureLight
pictureLight: number;How bright the pictures are lit (the client's WorldDetail.pictureLight)
play
play(id: number, clip: string, options?: {
loop?: boolean;
speed?: number;
onEnd?: () => void;
}): boolean;Plays a clip of a doodad's model on it (the client's DoodadView.play): over and over (loop, yes when left out), once (onEnd told as it ends, held at its last frame after: a chest opened stays open). It is drawn on a skeleton of its own while it plays and after (a prop of the units' view: no copy of it, no chunk), until settle. False where the model is known not to have the clip, or nothing draws props
playing
playing(id: number): string | undefined;The clip a doodad plays now, by its name
prepare
prepare(): Promise<void>;Behind the loading screen: waits for the models, their levels' files and their pictures, then lays everything out at the level it is seen at from where the camera is, with nothing fading and every chunk merged
props
props?: SceneryProps;What draws a doodad playing a clip on a skeleton of its own (the units' view's props, the world's): none, and no doodad plays one (play is false)
reach
reach(doodad: MapDoodad): number;How far from its middle a doodad reaches on the ground, in cells
recheck
recheck(model?: string): void;What may be merged worked out again (of one model's doodads, or all): what may be is merged (drawn as copies until its chunk is), what may no longer be leaves its chunk for copies
released
readonly released: string[];The levels' files let go of over the budget, in order: for a panel or a test
relevel
relevel(): void;Everything looked at again in the next frame: the levels said changed (options.detail, the quality)
relight
relight(): void;The lights of every doodad worked out again: what the game says of them changed
reload
reload(files: readonly string[]): Promise<void>;Model files changed on disk (hotFiles): a model or a level's file read before read anew (SceneryModels.reload), and every doodad of such a model laid again from it (its copies, its chunk merged again, its picture baked again), the old let go of once they are; a file that does not load leaves what there was (the client's doodads.reload)
remove
remove(id: number): void;Takes the doodad with an id away, its lights and its place in a chunk with it: nothing where there is none
scale
get scale(): number;What every from of a level is multiplied by: the quality's, times the map's or else the game's
seeThrough
seeThrough(id: number, share: number, hole?: boolean): void;How much of a doodad is drawn while it stands in the way of a unit seen through it (lite/units/seeThrough.ts): 1 whole; less, a copy of its own (out of its chunk, as lift takes it) in its model's fading batch, its pixels left out by the share as a level's fade leaves them (levelFadeOut); hole, in front of a unit cut round (cutout), the same with the see-through's holes cut through it (the fading batch's hole variant, where the scenery was given the holes: SceneryOptions.holes). While it is seen through it fades between levels at once
sense
sense?: () => SceneryDetailSense;What the levels go by beside the distance (the client's picker's: the regions the camera is over, the screen): the lite client's client.detail as it has them; the distance alone, the regions none, when left out
set
set(doodads: readonly MapDoodad[]): void;The scenery of a map: what is not in doodads goes, what is new or changed comes
settle
settle(id: number): void;A doodad drawn as the rest again (the client's DoodadView.settle: merged once it has been still a while), but for a clip its model or it declares, which it goes on playing
sizeOf
sizeOf(model: string): readonly [number, number, number] | undefined;A model's size as it was made (across, up, deep), once it has loaded
stats
get stats(): SceneryStats;What it draws now: doodads by how they are drawn and at what level, chunks, batches, models
stop
stop(id: number): void;Stops the clip a doodad plays, where it is: it stays as it stopped, on its own, until settle
version
get version(): number;Counts up whenever the scenery changes: what draws from it (a minimap) knows to draw again