dummies
The crash test dummy API of the `crashDummies` package: `require("crashDummies.dummies")`.
dummies
The crash test dummy API of the crashDummies package: require("crashDummies.dummies").
Builds ragdoll crash test dummies out of rigid bodies (capsules, boxes, spheres) joined by hinge and
generic joints with anatomical limits and capped spring-damper "muscle tone", seats them at a
vehicle's seat_<x> H-point frame, belts them to the vehicle's belt_<seat>_* anchors with
compliant one-sided webbing (slack, retractor spool-out, pyro pretensioner, load limiter), and draws
the webbing on every peer.
spawn(opts) -> handle—{ kind, look, belt, vehicle, seat = "seat_driver", synced = true, tone = 0.5, handsInLap? }despawn(handle),setTone(handle, 0..1)instrument(handle) -> { read, reset, peak, trace, belt, stop }— motion probes on head / chest / pelviscatalog(),looks(),belts()— the variants with their masses and settingsCOLLISION_GROUP— the membership bit (21) every dummy collider carries
Called by game code and by the package's CrashDummy component (which runs the belts each physics
step on the simulating peer). See the package README for the full contract and measured numbers.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
v3(x: number, y: number, z: number) → V return
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| z | number |
add(a: V, b: V) → V return
| arg | type | description |
|---|---|---|
| a | V | |
| b | V |
sub(a: V, b: V) → V return
| arg | type | description |
|---|---|---|
| a | V | |
| b | V |
mul(a: V, s: number) → V return
| arg | type | description |
|---|---|---|
| a | V | |
| s | number |
dot(a: V, b: V) → number return a
| arg | type | description |
|---|---|---|
| a | V | |
| b | V |
cross(a: V, b: V) → V
| arg | type | description |
|---|---|---|
| a | V | |
| b | V |
len(a: V) → number return math
| arg | type | description |
|---|---|---|
| a | V |
norm(a: V) → V
| arg | type | description |
|---|---|---|
| a | V |
qmul(a: Q, b: Q) → Q
| arg | type | description |
|---|---|---|
| a | Q | |
| b | Q |
qconj(q: Q) → Q return
| arg | type | description |
|---|---|---|
| q | Q |
qrot(q: Q, p: V) → V
| arg | type | description |
|---|---|---|
| q | Q | |
| p | V |
qfromto(a: V, b: V) → Q
| arg | type | description |
|---|---|---|
| a | V | |
| b | V |
qaxis(axis: V, deg: number) → Q
| arg | type | description |
|---|---|---|
| axis | V | |
| deg | number |
_readV(p: any) → V return
| arg | type | description |
|---|---|---|
| p | any |
_readQ(r: any) → Q return
| arg | type | description |
|---|---|---|
| r | any |
kindMass(k: Kind) → number
| arg | type | description |
|---|---|---|
| k | Kind |
dummyGroup(id: string) → void
| arg | type | description |
|---|---|---|
| id | string |
findUnder(rootId: string, name: string) → string
| arg | type | description |
|---|---|---|
| rootId | string | |
| name | string |
spawnE(name: string, parent: string?, synced: boolean) → any
| arg | type | description |
|---|---|---|
| name | string | |
| parent | string? | |
| synced | boolean |
buildSkeleton(k: Kind, opts: any, wheelLocal: V?) → any
| arg | type | description |
|---|---|---|
| k | Kind | |
| opts | any | |
| wheelLocal | V? |
along(d: number) → V return add
| arg | type | description |
|---|---|---|
| d | number |
ik(a: V, target: V, l1: number, l2: number, pole: V) → void
| arg | type | description |
|---|---|---|
| a | V | |
| target | V | |
| l1 | number | |
| l2 | number | |
| pole | V |
hingeAxis(u: V, f: V, fallback: V) → void
| arg | type | description |
|---|---|---|
| u | V | |
| f | V | |
| fallback | V |
mats( ) → void
try(name: string, f: () → void
| arg | type | description |
|---|---|---|
| name | string | |
| f | ( |
vis(parent: string, synced: boolean, mesh: any, mat: any, pos: V, rot: Q?, scale: V) → any
| arg | type | description |
|---|---|---|
| parent | string | |
| synced | boolean | |
| mesh | any | |
| mat | any | |
| pos | V | |
| rot | Q? | |
| scale | V |
pose(id: string) → void
| arg | type | description |
|---|---|---|
| id | string |
drawn(id: string) → void
| arg | type | description |
|---|---|---|
| id | string |
anchorName(seat: string, which: string) → void
| arg | type | description |
|---|---|---|
| seat | string | |
| which | string |
findAnchor(vehicle: string, seat: string, which: string) → string
| arg | type | description |
|---|---|---|
| vehicle | string | |
| seat | string | |
| which | string |
worldToLocal(id: string, w: V) → V
| arg | type | description |
|---|---|---|
| id | string | |
| w | V |
bodyOf(id: string) → string
The rigid body an entity rides on: itself or its nearest ancestor with a Physics component.
| arg | type | description |
|---|---|---|
| id | string |
anchorsOnBodies(straps: { Strap }) → void
Re-express every strap's anchor on the rigid body that carries it. A marker entity's transform is refreshed once per frame, but the belts run every physics step (several per frame when the engine is behind), so reading a marker inside a step hook lags by a step's travel: 23 cm at 50 km/h. A body's pose is current inside the hook.
| arg | type | description |
|---|---|---|
| straps | { Strap } |
W(p: V) → V return add
| arg | type | description |
|---|---|---|
| p | V |
L(p: V) → V return qrot
| arg | type | description |
|---|---|---|
| p | V |
bodyLocal(seg: string, seatLocalPoint: V) → V return sub
| arg | type | description |
|---|---|---|
| seg | string | |
| seatLocalPoint | V |
push(name: string, seg: string, pt: V, anchor: string, anchorLocal: V, sh: boolean) → void
| arg | type | description |
|---|---|---|
| name | string | |
| seg | string | |
| pt | V | |
| anchor | string | |
| anchorLocal | V | |
| sh | boolean |
lapPt(sx: number, inset: number) → V return v3
| arg | type | description |
|---|---|---|
| sx | number | |
| inset | number |
chestPt(up: number, sx: number, out: number) → V
| arg | type | description |
|---|---|---|
| up | number | |
| sx | number | |
| out | number |
cs(seatLocal: V) → V return worldToLocal
5-point harness on the child seat's own anchors (anchor-local points on the child seat body).
| arg | type | description |
|---|---|---|
| seatLocal | V |
side(id: string) → number
| arg | type | description |
|---|---|---|
| id | string |
massScale(k: Kind) → number return kindMass
| arg | type | description |
|---|---|---|
| k | Kind |
buildVisuals(h: any, sk: any, k: Kind, look: Look, bodyCentre: { [string]: V }, synced: boolean) → void
| arg | type | description |
|---|---|---|
| h | any | |
| sk | any | |
| k | Kind | |
| look | Look | |
| bodyCentre | { [string]: V } | |
| synced | boolean |
mat(role: string) → any return MT
| arg | type | description |
|---|---|---|
| role | string |
lp(seg: string, p: V) → V return sub
| arg | type | description |
|---|---|---|
| seg | string | |
| p | V |
collider(body: string, synced: boolean, shape: string, pos: V, rot: Q?, data: any) → void
| arg | type | description |
|---|---|---|
| body | string | |
| synced | boolean | |
| shape | string | |
| pos | V | |
| rot | Q? | |
| data | any |
selfCollider(id: string, shape: string, data: any) → void
A Physics body whose own entity carries no collider gets a default 1 m box from the engine, child colliders or not; so every body carries a shape itself (a small core sphere, or its main shape).
| arg | type | description |
|---|---|---|
| id | string | |
| shape | string | |
| data | any |
buildColliders(h: any, sk: any, k: Kind, bodyCentre: { [string]: V }, synced: boolean) → void
| arg | type | description |
|---|---|---|
| h | any | |
| sk | any | |
| k | Kind | |
| bodyCentre | { [string]: V } | |
| synced | boolean |
boosterVisuals(id: string, synced: boolean, thick: number) → void
Child restraint props. Each is a rigid body fixed to the vehicle at the seat frame (the joint frames coincide at spawn, so the joint starts unloaded). The drawn parts of the booster, on its entity (centred on the cushion block).
| arg | type | description |
|---|---|---|
| id | string | |
| synced | boolean | |
| thick | number |
buildBooster(root: string, synced: boolean, seatId: string, vehicle: string, seatP: V, seatQ: Q, top: number) → string
| arg | type | description |
|---|---|---|
| root | string | |
| synced | boolean | |
| seatId | string | |
| vehicle | string | |
| seatP | V | |
| seatQ | Q | |
| top | number |
childSeatFrame(sk: any, k: Kind, top: number) → any
The child seat's frame in the seat frame: its base block centre, and the back / wing / head-wing centres the colliders and the drawn parts share.
| arg | type | description |
|---|---|---|
| sk | any | |
| k | Kind | |
| top | number |
childSeatVisuals(id: string, synced: boolean, sk: any, k: Kind, top: number) → void
The drawn parts of the child seat, on its entity (centred on the base block).
| arg | type | description |
|---|---|---|
| id | string | |
| synced | boolean | |
| sk | any | |
| k | Kind | |
| top | number |
l(p: V) → V return sub
| arg | type | description |
|---|---|---|
| p | V |
buildChildSeat(root: string, synced: boolean, seatId: string, vehicle: string, seatP: V, seatQ: Q, sk: any, k: Kind, top: number) → string
| arg | type | description |
|---|---|---|
| root | string | |
| synced | boolean | |
| seatId | string | |
| vehicle | string | |
| seatP | V | |
| seatQ | Q | |
| sk | any | |
| k | Kind | |
| top | number |
l(p: V) → V return sub
| arg | type | description |
|---|---|---|
| p | V |
resolveVehicle(v: any) → string
| arg | type | description |
|---|---|---|
| v | any |
genericLimits(j: Joint) → any
Per-axis limits of a generic joint from anatomical ranges. The frame's X is the joint axis; its Y / Z are the body's own carried by the shortest turn onto the axis, so find which of them is the flexion axis and which way round it reads.
| arg | type | description |
|---|---|---|
| j | Joint |
toneMotors(jt: any, x: number) → any
The joint "muscle": a capped spring-damper pulling toward the seated pose (force model, so the numbers are N·m per radian, N·m·s per radian and N·m). Tone 0..1 scales it 0.25x..1.75x.
| arg | type | description |
|---|---|---|
| jt | any | |
| x | number |
m( ) → any return
spawn(opts: any) → any
Seat a ragdoll crash test dummy in a vehicle seat, belted.
| arg | type | description |
|---|---|---|
| opts | any | { kind, look, belt, vehicle = chassisId, seat = "seat_driver", synced = true, tone = 0.5 } |
examples
local d = Dummies.spawn({ kind = "adult50", look = "classic", belt = "threePoint", vehicle = car.id, seat = "seat_driver" })toSeat(p: V) → V return qrot
| arg | type | description |
|---|---|---|
| p | V |
W(p: V) → V return add
| arg | type | description |
|---|---|---|
| p | V |
off(p: V) → V return add
move the whole skeleton by the child-restraint offset
| arg | type | description |
|---|---|---|
| p | V |
_beltStep(h: any, dt: number) → void
| arg | type | description |
|---|---|---|
| h | any | |
| dt | number |
_drawWebbing(state: any) → void
| arg | type | description |
|---|---|---|
| state | any |
_buildWebbing(rootId: string, straps: { any }) → any
Builds the cosmetic webbing for a dummy root on THIS peer (local entities under the root).
| arg | type | description |
|---|---|---|
| rootId | string | |
| straps | { any } |
add1(a: string, aLocal: V, b: string, bLocal: V, width: number) → void
| arg | type | description |
|---|---|---|
| a | string | |
| aLocal | V | |
| b | string | |
| bLocal | V | |
| width | number |
_remoteStraps(rootId: string, kindId: string, beltId: string, vehicle: string, seat: string, hasChildSeat: boolean) → void
Rebuild the strap plan on a peer that did not spawn the dummy (names are the same everywhere).
| arg | type | description |
|---|---|---|
| rootId | string | |
| kindId | string | |
| beltId | string | |
| vehicle | string | |
| seat | string | |
| hasChildSeat | boolean |
despawn(d: any) → void
Remove a dummy (and its booster / child seat) from the world.
| arg | type | description |
|---|---|---|
| d | any | the handle Dummies.spawn returned |
setTone(d: any, x: number) → void
Set joint resistance: 0 = limp, 1 = stiff (default 0.5, roughly a lab's 1 g joint setting).
| arg | type | description |
|---|---|---|
| d | any | the handle |
| x | number | tone 0..1 |
instrument(d: any) → any
Put accelerometers on the head, chest and pelvis (motion probes at solver-substep rate).
| arg | type | description |
|---|---|---|
| d | any | the handle |
read( ) → void
reset( ) → void
belt( ) → void
stop( ) → void
spawnVisual(opts: any) → any
Build a dummy's LOOK only, seated in its pose: the drawn segments, its booster or child seat, and (with `belt`) the webbing drawn straight from anchors it places itself. No physics, no joints, no collision filters, so it works inside a scene build (a gallery, a showroom, a menu backdrop).
| arg | type | description |
|---|---|---|
| opts | any | { kind, look, belt = "none", parent?, position = {0,0,0}, yaw = 0, synced = false, name? } |
examples
local v = Dummies.spawnVisual({ kind = "child6", look = "cartoon", belt = "threePoint", position = { 0, 0.45, 0 }, yaw = 180 })off(p: V) → V return add
| arg | type | description |
|---|---|---|
| p | V |
anchor(which: string, p: V, scale: V?) → void
| arg | type | description |
|---|---|---|
| which | string | |
| p | V | |
| scale | V? |
world(id: string, l: V) → V
| arg | type | description |
|---|---|---|
| id | string | |
| l | V |
strap(a: V, b: V, width: number) → void
| arg | type | description |
|---|---|---|
| a | V | |
| b | V | |
| width | number |
catalog( ) →
Every dummy kind, in display order, with its mass and stature.
looks( ) →
Every look, in display order.
belts( ) →
Every restraint, in display order.
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.