bonemesh
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
bonemesh
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2game.player.bonemesh — procedural bone geometry and the player's materials. Every shape here is generated from numbers: a bone's `seed` drives its knobs, chips, cracks, rope bindings and bend; `length` and `weight` drive its proportions. Meshes are runtime GPU meshes (renderer.mesh.create), cached by a quantised key so a hundred dropped bones share a few dozen meshes. Model space: +Y up, -Z forward (the engine's facing). local BM = require("game.player.bonemesh") local mesh = BM.longBone(seed, length, thick) -- along +Y, 0..length local mats = BM.materials() -- bone / ecto / eye / iron
ihash(i: number, j: number, k: number, seed: number) → number
| arg | type | description |
|---|---|---|
| i | number | |
| j | number | |
| k | number | |
| seed | number |
smooth(t: number) → number return t
| arg | type | description |
|---|---|---|
| t | number |
vnoise(seed: number, x: number, y: number, z: number) → number
| arg | type | description |
|---|---|---|
| seed | number | |
| x | number | |
| y | number | |
| z | number |
L(a: ?, b: ?, t: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? | |
| t | ? |
fbm(seed: number, x: number, y: number, z: number) → number
| arg | type | description |
|---|---|---|
| seed | number | |
| x | number | |
| y | number | |
| z | number |
v3(x: ?, y: ?, z: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| y | ? | |
| z | ? |
add(a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? |
sub(a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? |
mul(a: ?, s: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| s | ? |
dot(a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? |
cross(a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? |
norm(a: ?) → void
| arg | type | description |
|---|---|---|
| a | ? |
lerp3(a: ?, b: ?, t: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? | |
| t | ? |
boneColor(seed: number, pos: ?, crack: boolean?) → void
A weathered bone colour at a point: ivory, grime, a little moss, hairline cracks.
| arg | type | description |
|---|---|---|
| seed | number | |
| pos | ? | |
| crack | boolean? |
newMesh( ) → void
v(x: number, y: number, z: number, r: number, g: number, b: number) → number
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| z | number | |
| r | number | |
| g | number | |
| b | number |
tri(a: number, b: number, c: number) → void
| arg | type | description |
|---|---|---|
| a | number | |
| b | number | |
| c | number |
tube(pts: ?, segs: number, rfn: ?, cfn: ?, capStart: number?, capEnd: number?) → void
A tube swept along `pts` (array of {x,y,z}); `rfn(t, ang, k, j)` gives the radius, `cfn(t, ang, pos)` the colour. `capStart`/`capEnd` are the lengths of the end cones (0/nil leaves the end open).
| arg | type | description |
|---|---|---|
| pts | ? | |
| segs | number | |
| rfn | ? | |
| cfn | ? | |
| capStart | number? | |
| capEnd | number? |
build( ) → void
Upload: smooth normals from the faces, then a runtime GPU mesh.
cached(key: string, make: () → void
| arg | type | description |
|---|---|---|
| key | string | |
| make | ( |
q(x: number, step: number) → number return floor
| arg | type | description |
|---|---|---|
| x | number | |
| step | number |
materials( ) → void
longBoneMesh(seed: number, length: number, thick: number, opts: any?) → void
A long bone (femur / humerus / tibia) along +Y from 0 to `length`, with knobbed twin-condyle ends, a bend, chips, cracks and two rope bindings. `thick` is the shaft radius. `glow` paints it ecto-green for magic bones.
| arg | type | description |
|---|---|---|
| seed | number | |
| length | number | |
| thick | number | |
| opts | any? |
endW(t: ?) → void
| arg | type | description |
|---|---|---|
| t | ? |
band(t: ?) → void
| arg | type | description |
|---|---|---|
| t | ? |
lump(c: ?, axis: ?, half: number, rad: number, colfn: ?) → void
A rounded lump (a condyle / knuckle) as a short closed tube along `axis`.
| arg | type | description |
|---|---|---|
| c | ? | |
| axis | ? | |
| half | number | |
| rad | number | |
| colfn | ? |
femur(seed: number, length: number, thick: number) → void
A femur: long shaft, flared ends, and TWIN condyles at both ends (the cartoon dog-bone silhouette of the bone_pickups reference), lying in the XY plane along +Y from 0 to `length` so the lobes read from the front.
| arg | type | description |
|---|---|---|
| seed | number | |
| length | number | |
| thick | number |
sCurve(size: number, curl: number, n: number) → void
Points of a spiral S (an Euler/Cornu spiral: both ends curl in opposite directions) in the XY plane, centred on the origin, `size` tall.
| arg | type | description |
|---|---|---|
| size | number | |
| curl | number | |
| n | number |
tailS(seed: number, size: number) → void
A tail bone as the reference draws it: a curled S of knuckled vertebrae with spurs on both edges, thick in the middle and tapering to curled hooks.
| arg | type | description |
|---|---|---|
| seed | number | |
| size | number |
ropeWrap(rad: number, y0: number, y1: number, turns: number) → void
A rope binding spiralling around a bone of radius `rad` along +Y from y0 to y1 (dark sinew), for the rune-wrapped magic bone.
| arg | type | description |
|---|---|---|
| rad | number | |
| y0 | number | |
| y1 | number | |
| turns | number |
runes(seed: number, rad: number, y0: number, y1: number, count: number) → void
Carved rune glyphs (zig-zag strokes) on the front face of a bone of radius `rad`, between y0 and y1; drawn with the emissive eye material.
| arg | type | description |
|---|---|---|
| seed | number | |
| rad | number | |
| y0 | number | |
| y1 | number | |
| count | number |
longBone(seed: number, length: number, thick: number, opts: any?) → void
| arg | type | description |
|---|---|---|
| seed | number | |
| length | number | |
| thick | number | |
| opts | any? |
clawBone(seed: number, length: number, thick: number) → void
A tapering spike bone (shin with a claw tip) along +Y from 0 to `length`.
| arg | type | description |
|---|---|---|
| seed | number | |
| length | number | |
| thick | number |
claw(seed: number, size: number) → void
A claw hand hanging along -Y, fingers curling forward (-Z).
| arg | type | description |
|---|---|---|
| seed | number | |
| size | number |
gauss(a: number, w: number) → number return exp
| arg | type | description |
|---|---|---|
| a | number | |
| w | number |
angTo(d: ?, c: ?) → number return math
| arg | type | description |
|---|---|---|
| d | ? | |
| c | ? |
segDist(p: ?, a: ?, b: ?) → number
| arg | type | description |
|---|---|---|
| p | ? | |
| a | ? | |
| b | ? |
crackDist(seed: number, d: ?) → number
| arg | type | description |
|---|---|---|
| seed | number | |
| d | ? |
skullDeform(seed: number, d: ?) → void
| arg | type | description |
|---|---|---|
| seed | number | |
| d | ? |
skull(seed: number, radius: number) → void
| arg | type | description |
|---|---|---|
| seed | number | |
| radius | number |
dir(i: ?, j: ?) → void
winding decided once on the undeformed sphere
| arg | type | description |
|---|---|---|
| i | ? | |
| j | ? |
noseCenter(radius: number) → void
Where the nasal cavity sits (model space), for the dark void behind it.
| arg | type | description |
|---|---|---|
| radius | number |
eyeCenters(radius: number) → void
Where the pupils sit inside a skull of `radius` (model space).
| arg | type | description |
|---|---|---|
| radius | number |
ribcage(seed: number, height: number, width: number) → void
A rib cage hanging down from its top (y = 0) to y = -height, spine at the back (+Z), sternum at the front, a pelvis ring at the bottom.
| arg | type | description |
|---|---|---|
| seed | number | |
| height | number | |
| width | number |
tail(seed: number, length: number, drop: number) → void
A vertebra tail starting at the origin and trailing back (+Z), drooping `drop` metres, with knuckled vertebrae and dorsal spurs, ending in a barb.
| arg | type | description |
|---|---|---|
| seed | number | |
| length | number | |
| drop | number |
ring( ) → void
Three crossed unit quads (XY, XZ, YZ) with 0..1 UVs, so an additive sprite material (mats.spark) reads as a glowing burst from every side. A glowing socket ring (torus in the XY plane, radius 1, tube 0.18).
sparkCard( ) → void
quad(ax: { number }, ay: { number }, nn: { number }) → void
| arg | type | description |
|---|---|---|
| ax | { number } | |
| ay | { number } | |
| nn | { number } |
blob(segs: number?) → void
A unit sphere-ish blob (for bolts, pupils, rivets).
| arg | type | description |
|---|---|---|
| segs | number? |
d(i: ?, j: ?) → void
| arg | type | description |
|---|---|---|
| i | ? | |
| j | ? |
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.