Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit8d45df8664

README.md

ecs.Light

Component spec for ecs.Light, which maps to the native Light. One component backs point, directional, ambient, and spot lights, selected by lightType. The constructor ecs.Light{...} builds a value the generic ecs verbs (ecs.insert / ecs.set / ecs.get) apply. color, direction, and face are vec3 composites; the cone angles apply to spot lights.

Fields

  • lightType: string? — "Point" | "Directional" | "Ambient" | "Spot".
  • color: { number }? — {r, g, b}.
  • intensity: number?
  • radius: number?
  • direction: { number }? — {x, y, z}.
  • coneInnerDeg: number? — spot cone inner angle (degrees).
  • coneOuterDeg: number? — spot cone outer angle (degrees).
  • face: { number }? — {x, y, z}.
  • castsShadows: boolean?

Usage

ecs.insert(id, ecs.Light{ lightType = "Point", color = { 1, 1, 1 }, intensity = 5, radius = 10 })