Skip to content

five-on-it / apps/client/src/renderer/ragdoll / Ragdolls

Class: Ragdolls ​

Defined in: apps/client/src/renderer/ragdoll.ts:562

Every ragdoll of the scene, by the id of whom it belongs to (a server entity, or the player's own): at most RAGDOLL_CAP simulating, the nearest; those outside the view paused; the settled ones frozen.

Constructors ​

Constructor ​

new Ragdolls(world): Ragdolls

Defined in: apps/client/src/renderer/ragdoll.ts:567

A set of ragdolls in world.

Parameters ​

world ​

RagdollWorld

Returns ​

Ragdolls

Accessors ​

counts ​

Get Signature ​

get counts(): object

Defined in: apps/client/src/renderer/ragdoll.ts:572

How many simulate now, and how many lie settled.

Returns ​

object

active ​

active: number

settled ​

settled: number

Methods ​

end() ​

end(id): Ragdoll | undefined

Defined in: apps/client/src/renderer/ragdoll.ts:611

Ends id's ragdoll (it got up, or is gone); returns it, if there was one.

Parameters ​

id ​

number

Returns ​

Ragdoll | undefined


get() ​

get(id): Ragdoll | undefined

Defined in: apps/client/src/renderer/ragdoll.ts:579

The ragdoll of id, if it has one.

Parameters ​

id ​

number

Returns ​

Ragdoll | undefined


prune() ​

prune(keep): void

Defined in: apps/client/src/renderer/ragdoll.ts:641

Forgets every ragdoll whose id keep turns down (people gone from the snapshots).

Parameters ​

keep ​

(id) => boolean

Returns ​

void


start() ​

start(id, points, velocity, spin?, near?): Ragdoll

Defined in: apps/client/src/renderer/ragdoll.ts:593

Starts id's ragdoll from points (world, m) with its velocity and spin, near metres from the camera's focus; beyond the cap, the farthest active one settles at once (this one, if it is the farthest).

Parameters ​

id ​

number

points ​

Float32Array

velocity ​
x ​

number

y ​

number

z ​

number

spin? ​
x ​

number

y ​

number

z ​

number

near? ​

number = 0

Returns ​

Ragdoll


stateOf() ​

stateOf(id): "none" | RagdollState

Defined in: apps/client/src/renderer/ragdoll.ts:584

The state of id's ragdoll: none without one.

Parameters ​

id ​

number

Returns ​

"none" | RagdollState


update() ​

update(id, dt, shown, anchor, near): Ragdoll | undefined

Defined in: apps/client/src/renderer/ragdoll.ts:622

Runs id's ragdoll dt seconds on if it is in view (shown), drifting toward anchor, near metres from the camera's focus; ends it when it is lost. Returns it while it lasts.

Parameters ​

id ​

number

dt ​

number

shown ​

boolean

anchor ​

{ x: number; y: number; z: number; } | undefined

near ​

number

Returns ​

Ragdoll | undefined