Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

entity.bounds (procNode)

A live scene entity's world-space axis-aligned bounds, its own renderable's or the whole hierarchy's, so an artist-placed box can be a scatter region. The bounds are read on the CPU when the graph cooks and again whenever the box changes.

Inputs

  • entity (Entity). Default "". The scene entity to measure: its Name or id. A name that finds no entity is refused, naming what was given.
  • include (one of self, hierarchy). Default "self". How much is measured: "self" the entity's own renderable, "hierarchy" the box around it and every descendant. An entity that draws nothing has no "self" box and is refused.

Outputs

  • bounds: the Record { min, max, center, size }, each a { x, y, z } in world space.

Example

local box = g.entity.bounds({ entity = "Volume" })

For an entity named Volume drawing a cube of size 2 standing at (5, 0, 0), box is { min = { x = 4, y = -1, z = -1 }, max = { x = 6, y = 1, z = 1 }, center = { x = 5, y = 0, z = 0 }, size = { x = 2, y = 2, z = 2 } }.