Skip to content

BushShake beta ​

Class of @v12-engine/client

ts
export declare class BushShake

Where 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 ​

ts
constructor(
    look?: FoliageShake);

Constructs a new instance of the BushShake class

active ​

ts
get active(): number;

How many places are shaken now

clear ​

ts
clear(): void;

Every place let go

counts ​

ts
counts(walker: CellWalker): boolean;

Whether this walker shakes them, as who says

disturb ​

ts
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 ​

ts
holds(id: number): boolean;

Whether a walker shakes them by a spring of its own now (update): one of the nearest

look ​

ts
look: FoliageShake;

How it shakes: changed in place, it shakes so from the next frame

places ​

ts
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 ​

ts
get radius(): number;

How far around one in them they are bent, in world units

radiusOf ​

ts
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 ​

ts
get strength(): number;

How far they bend, 1 as made

update ​

ts
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 ​

ts
readonly wobbles: Float32Array<ArrayBuffer>;

For the shader, a place each: how much it wobbles, and where in its swing (radians)