Skip to content

five-on-it / apps/client/src/renderer/models / ActorModels

Interface: ActorModels ​

Defined in: apps/client/src/renderer/models.ts:331

The models the actors are drawn with.

Properties ​

batched ​

readonly batched: object

Defined in: apps/client/src/renderer/models.ts:387

Instances drawn by the last flush, and the batch meshes the scene holds.

instances ​

instances: number

meshes ​

meshes: number


clips ​

readonly clips: ClipLibrary | undefined

Defined in: apps/client/src/renderer/models.ts:335

The character's clips, once loaded (clips.ts).


joints ​

readonly joints: ReadonlyMap<"head" | "torso" | "arm-l" | "arm-r" | "forearm-l" | "forearm-r" | "leg-l" | "leg-r" | "shin-l" | "shin-r", Vector3>

Defined in: apps/client/src/renderer/models.ts:337

Where each of the character's joints is at rest, in the actor's frame (m, the feet at the origin, facing +z); empty before the files are in.


lightBars ​

readonly lightBars: boolean

Defined in: apps/client/src/renderer/models.ts:389

Whether the light bars are loaded (their lamps' materials).


ready ​

readonly ready: boolean

Defined in: apps/client/src/renderer/models.ts:333

Whether every file is loaded; before that (and when a file fails) the actors are boxes.

Methods ​

doors() ​

doors(name): readonly DoorInfo[]

Defined in: apps/client/src/renderer/models.ts:341

The doors of the vehicle model name (none for an open one, or before the files are loaded).

Parameters ​

name ​

string

Returns ​

readonly DoorInfo[]


draw() ​

draw(name, world, tint, options?): boolean

Defined in: apps/client/src/renderer/models.ts:364

Draws the model name this frame as spawn would show it under a node whose world matrix is world, tinted tint: an instance in each of its batches. Returns false when there is no such model (or the files are not in yet).

Parameters ​

name ​

string

world ​

Matrix

tint ​

Color3

options? ​

DrawOptions

Returns ​

boolean


drawWeapon() ​

drawWeapon(world, options): boolean

Defined in: apps/client/src/renderer/models.ts:381

Draws only the weapon a figure under world holds (options.weapon), the figure posed by options: the player's own figure, a clone the scene graph draws, holds its weapon so.

Parameters ​

world ​

Matrix

options ​

DrawOptions

Returns ​

boolean


flashLightBars() ​

flashLightBars(ms): void

Defined in: apps/client/src/renderer/models.ts:391

Lights every light bar's lamps as its livery's pattern has them at ms, and darkens the others.

Parameters ​

ms ​

number

Returns ​

void


flush() ​

flush(): void

Defined in: apps/client/src/renderer/models.ts:385

Hands this frame's instances to the batches; once a frame, after every draw, before the scene renders.

Returns ​

void


glass() ​

glass(name): GlassGeometry | undefined

Defined in: apps/client/src/renderer/models.ts:343

The glass of the vehicle model name, once loaded; undefined for a model without any.

Parameters ​

name ​

string

Returns ​

GlassGeometry | undefined


hand() ​

hand(world, side, options, out): boolean

Defined in: apps/client/src/renderer/models.ts:370

Where the tip of a character's fist is this frame (its right with side r, its left with l), the figure drawn under world as draw would draw it with options, into out. Returns false before the files are in.

Parameters ​

world ​

Matrix

side ​

"r" | "l"

options ​

DrawOptions

out ​

Vector3

Returns ​

boolean


muzzle() ​

muzzle(world, weapon, options, out): boolean

Defined in: apps/client/src/renderer/models.ts:376

Where the muzzle of the weapon weapon (a model's name) is this frame, held by a figure drawn under world with options, into out. Returns false before the files are in, or for a weapon without a muzzle (a grenade).

Parameters ​

world ​

Matrix

weapon ​

string

options ​

DrawOptions

out ​

Vector3

Returns ​

boolean


offCentre() ​

offCentre(name): number

Defined in: apps/client/src/renderer/models.ts:347

How far the middle of the model name lies from its actor's origin on the ground (m): 0 for a model hung where it should be.

Parameters ​

name ​

string

Returns ​

number


paintOf() ​

paintOf(tint, wrecked): Color3

Defined in: apps/client/src/renderer/models.ts:383

The colour a model tinted tint is painted in: the tint, or a wreck's scorched (the same object every time).

Parameters ​

tint ​

Color3

wrecked ​

boolean

Returns ​

Color3


seats() ​

seats(name): readonly Seat[]

Defined in: apps/client/src/renderer/models.ts:339

The seats of the vehicle model name, by seat index (0 the driver's); none before the files are loaded.

Parameters ​

name ​

string

Returns ​

readonly Seat[]


spawn() ​

spawn(name, parent, tint, options?): TransformNode | undefined

Defined in: apps/client/src/renderer/models.ts:353

Hangs a tinted clone of the model name under parent (a car's node at its chassis centre; a person's at its capsule centre, the feet drop metres below), or returns undefined when there is no such model. wrecked scorches it as a wreck is drawn.

Parameters ​

name ​

string

parent ​

TransformNode

tint ​

Color3

options? ​
drop? ​

number

wrecked? ​

boolean

Returns ​

TransformNode | undefined


turning() ​

turning(name): number

Defined in: apps/client/src/renderer/models.ts:345

How many parts of the vehicle model name turn as it steers (its front wheels and its steering wheel; none for a two-wheeler or a trailer, or before the files are in).

Parameters ​

name ​

string

Returns ​

number