Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit3bb1da2647

README.md

ecs.components

Component-spec namespace — re-exports every native ECS component spec under ecs.components.<Name>. Each spec describes one native component: its public name, the Rust type it maps to, and the per-field entries the generic ecs verbs use to build and read Rust-shaped values. The sibling ecs module registers each spec to mint its typed constructor (ecs.Mesh, ecs.Transform, ...).

Spec shape

Each spec is a table with:

  • name — the public component name ("Mesh").
  • rust — the native type it maps to ("MeshInstance").
  • entries — per-field descriptors { luau, rust?, kind, expand? }. luau is the camelCase field a caller writes; rust is the underlying snake_case field; kind is the conversion kind (string, bool, number, vec3, meshHandle, materialHandle, textureHandle, assetRef, struct); expand lists the rust scalars a vec3 expands into.
  • behavior(id) -> { method = fn } — optional per-entity imperative methods the ecs.get handle exposes.
  • static = { fn = function(id, ...) end } — optional component-level operations that take an explicit entity id.

Members

Mesh, Material, Transform, Physics, Light, Collider, CollisionGroups, PlaneHold, GravityField, Force, FluidForces, LiftSurface, PhysicsJoint, PhysicsLatch, WheelCollider, ShaftNetwork, SoftBody, AudioSource, Camera, Sky, PlayerOwned, Skeleton, TransformConstraints. Each lives in its own .module/ folder.

Usage

local Specs = require("modules.api.engine.ecs.components")
for name, spec in Specs do
    print(name, spec.rust)
end