Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit44fd9e59bd

README.md

Built-in primitive meshes

The .mesh assets in this folder are the engine's built-in primitive geometry — the rough-blockout shapes every world can reference by bare name ({ model = "cube" }) without authoring or importing anything.

Each <name>.mesh is a loader-folder asset whose primary content is the engine-native ZMSH geometry binary at <name>.mesh/data.zmsh. The folder carries a .metadata sidecar tagging it primitive and builtin, and a committed .meta sidecar pinning its stable guid (authored content references the guid, never the name).

Each is centred on its local origin, so an entity's scale reads directly as the size the mesh covers in the world.

AssetShapeExtent (x, y, z)
cubeunit cube1 x 1 x 1
sphereUV sphere1 x 1 x 1
planeflat quad (XZ)1 x 0 x 1
cylindercapped cylinder1 x 1 x 1
conecapped cone1 x 1 x 1
capsulerounded-end capsule0.5 x 1 x 0.5
rounded_boxbox with rounded edges and corners1 x 1 x 1
torusring1 x 0.3 x 1
octahedron8-faced diamond1 x 1 x 1
ground_hexhexagonal ground tile1.732 x 0.1 x 2
ground_quadlarge ground quad1 x 0.1 x 1
shader_ballsphere on a pedestal, a quarter of its upper half cut away — what a shader's preview is painted on0.933 x 1 x 0.933

meshRef:load():getBounds() reads the same numbers back. guides { path = "types/mesh" } carries the winding, index-base, UV and axis conventions the geometry is authored against.

Publishing the geometry blobs

These meshes resolve their data.zmsh bytes by sha-256 (content addressing) on targets that don't have the repo's src/lua/lib on disk — WASM (the browser build) and release native binaries run outside the repo. That requires each blob to exist in ZeroMind's content store. Publish them with:

node scripts/publish_builtin_blobs.mjs        # upload (skips blobs already present)
node scripts/publish_builtin_blobs.mjs --dry-run

The upload set is derived from the build's BUILTIN_LIB_BINARY_LEAVES, so build the engine once (cargo build --bin native) before publishing. The script is idempotent: a blob whose sha already exists in the store is left untouched.

Primitives are for blockout, not finished work — author or import real geometry for anything shipping.