BushShake beta
Class of @v12-engine/client
export declare class BushShakeWhere bushes are shaken, worked out each frame on the CPU and handed to their shader as a few numbers a place: where, how far around, how far they are bent now (a spring that overshoots and settles) and how much they wobble. The same for tall grass and for a game's own models
Members
constructor
constructor(
look?: FoliageShake);Constructs a new instance of the BushShake class
active
get active(): number;How many places are shaken now
clear
clear(): void;Every place let go
counts
counts(walker: CellWalker): boolean;Whether this walker shakes them, as who says
disturb
disturb(x: number, z: number, strength?: number): void;A shake at a place, not of a walker the player sees: told by the rules (one hidden moving in it, rustle), or by a game's code (an explosion, a deer). strength 1 as one moving through
holds
holds(id: number): boolean;Whether a walker shakes them by a spring of its own now (update): one of the nearest
look
look: FoliageShake;How it shakes: changed in place, it shakes so from the next frame
places
readonly places: Float32Array<ArrayBuffer>;For the shader, a place each: x, z, how far around (0 for a place not shaken), how far bent
radius
get radius(): number;How far around one in them they are bent, in world units
radiusOf
radiusOf?: (walker: CellWalker) => number;How far around a walker it bends, by the walker (FoliageWalked.radius size: by the unit's own): the look's radius for every one when none
strength
get strength(): number;How far they bend, 1 as made
update
update(dt: number, inside: readonly CellWalker[], entered?: (walker: CellWalker) => void, count?: number): void;Every frame: those in the bushes now who shake them, the nearest the camera first (those past the places there are shake none); entered hears of each that stepped in this frame. count: the first so many of inside (all of them when left out), for a list kept from frame to frame
wobbles
readonly wobbles: Float32Array<ArrayBuffer>;For the shader, a place each: how much it wobbles, and where in its swing (radians)