Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit8d45df8664

README.md

ecs.PlaneHold

Spec for ecs.PlaneHold, which maps to the native PlaneHold: holds bodies to a plane, the way a side-on 2D or 2.5D game keeps everything in one plane of a 3D world. The PlaneHold component drives it; this is the typed value the generic ecs verbs build and read.

Fields

  • normal: { x, y, z }?: the plane's normal, in world space. A zero normal holds nothing.
  • point: { x, y, z }?: a point on the plane, in world space.
  • covers: string?: the PlaneHoldCover variant name, "Subtree" (the entity's body and every body under it), "Group" (every body whose collision membership shares a bit with groups) or "World" (every body).
  • groups: number?: the collision groups a "group" hold covers, as a bitmask.
  • enabled: boolean?: whether the hold acts; one switched off is passed over.
  • free: boolean?: the hold covers its bodies with no plane, which opts them out of a hold further out.

Usage

ecs.insertSync(id, ecs.PlaneHold{ normal = { x = 0, y = 0, z = 1 }, point = { x = 0, y = 0, z = 0 }, covers = "Subtree" })
ecs.set(id, ecs.PlaneHold{ enabled = false })