Builtin Library
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, orcolliders = truewithsensors.fields(Record, optional). What to read:{ pose = true, space = "world" | "local" }, or a list ofposition,rotation,scale,id,shapeType,params, orComponent.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, andcount.
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.