Skip to content

five-on-it / apps/client/src/renderer/figure / Figure

Class: Figure ​

Defined in: apps/client/src/renderer/figure.ts:91

One character's animated figure.

Constructors ​

Constructor ​

new Figure(root, source, seen?): Figure

Defined in: apps/client/src/renderer/figure.ts:149

The figure of an actor's node (createActor, or an ActorNode), its clips from source once loaded; every clip it shows is added to seen, if given (what the tests read: a clip of a moment is missed between two readings at a low frame rate).

Parameters ​

root ​

FigureRoot

source ​

ClipSource

seen? ​

Set<string>

Returns ​

Figure

Properties ​

rootAt ​

readonly rootAt: Vector3

Defined in: apps/client/src/renderer/figure.ts:95

The root's place and turn (the empty at the feet: a crouch drops it, a roll turns it).


rootTurn ​

readonly rootTurn: Quaternion

Defined in: apps/client/src/renderer/figure.ts:96


turns ​

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

Defined in: apps/client/src/renderer/figure.ts:93

Its parts' turns as posed by the last update (the same objects every frame).

Accessors ​

clip ​

Get Signature ​

get clip(): string

Defined in: apps/client/src/renderer/figure.ts:189

The clip shown now: a full one-shot or the base, with the upper clip (or an upper one-shot) after a + (walk+hold-rifle).

Returns ​

string


posable ​

Get Signature ​

get posable(): boolean

Defined in: apps/client/src/renderer/figure.ts:179

Whether the node has parts to pose (a model, not a box).

Returns ​

boolean


shownPose ​

Get Signature ​

get shownPose(): Pose

Defined in: apps/client/src/renderer/figure.ts:165

The pose shown (read only: a ragdoll starts from it).

Returns ​

Pose


weapon ​

Get Signature ​

get weapon(): string | undefined

Defined in: apps/client/src/renderer/figure.ts:184

The weapon shown in its hands, by its model's name (pistol, rocket-launcher); none with empty hands.

Returns ​

string | undefined

Methods ​

play() ​

play(name, now, length?): void

Defined in: apps/client/src/renderer/figure.ts:198

Plays a one-shot from now (s, the page's clock): a clip by name (a recoil, a punch, a door, an emote), for its length or length seconds (a looping clip, a burst of it). A clip the library has not is ignored.

Parameters ​

name ​

string

now ​

number

length? ​

number

Returns ​

void


riseFrom() ​

riseFrom(turn): void

Defined in: apps/client/src/renderer/figure.ts:173

Gets up from a ragdoll: the next turn upright starts from turn (the body's as the ragdoll left it) instead of the node's.

Parameters ​

turn ​

Quaternion

Returns ​

void


update() ​

update(state, dt, now): void

Defined in: apps/client/src/renderer/figure.ts:221

Poses the figure for this frame, dt seconds after the last, now the page's clock (s); its node has been placed and turned already (while it gets up, this turns it the rest of the way).

Parameters ​

state ​

FigureState

dt ​

number

now ​

number

Returns ​

void