Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

core.entity.read (procNode)

Read live entities as columns, one element per entity, with the number read as count.

Built from io.engine with readEntities, then op.transfer.upload of the columns it answers. The result is one Record: a column for each field read, and count; core.points makes points of it. The query names the entities by ids (a list of entity ids), name (a Name or glob), component, or colliders (with sensors); fields is { pose = true, space = "world" } for P, orient and scale, or a list of position, rotation, scale, id, shapeType, params and Component.field names.

Inputs

  • query (Record). Which entities: ids (entity ids), name (a Name or a glob), component, or colliders = true with sensors.
  • fields (Record, optional). What to read: { pose = true, space = "world" | "local" }, or a list of position, rotation, scale, id, shapeType, params, or Component.field.
  • space (one of world, local). Default "world". The space the pose fields of a list are read in.

Outputs

  • read: Record of one column per field read, and count.

Example

local read = g.core.entity.read({ query = { name = "Lamp*" }, fields = { pose = true, space = "world" } })
local points = g.core.points({ count = read.count, columns = { P = read.P, entity = read.id } })

read.count is how many entities the name matched; read.P, read.orient and read.scale hold their poses and read.id their entity ids, which points carries as entity.