Engine
core.engine.get_entities
SharedRetrieves all registered entities of a specified category
Syntax
local result = core.engine.get_entities(
category,
streamed = false
)Parameters
| Type | Name | Description |
|---|---|---|
string | category | Entity category to query Refer Entity Types section |
boolean | streamed | Determines which entities to include: • When true - returns only entities currently streamed into the camera frustum• When false - returns all entities regardless of streaming state |
Returns
| Type | Name | Description |
|---|---|---|
table | result | A table containing all matching entities of the specified category |
Entity Types
| Category | Availability | Streamable | Dimension | Notes |
|---|---|---|---|---|
core.model | client | server | ✓ | ✓ | Frustum-culled |
core.camera | client | — | ✓ | Selects the dimension it renders |
core.webview | client | — | — | |
core.font | client | — | — | |
core.image | client | — | — | |
core.svg | client | — | — | |
core.rendertarget | client | — | — | |
core.display | client | — | — | |
core.shader | client | — | — | |
core.audio_2d | client | — | — | |
core.audio_3d | client | ✓ | ✓ | Frustum-culled positional audio |
core.database | server | — | — | |
core.db_query | server | — | — | |
util.timer | client | server | — | — | |
util.promise | client | server | — | — | |
util.thread | client | server | — | — | |
light.directional | client | ✓ | ✓ | Always streamed |
light.point | client | ✓ | ✓ | Frustum-culled |
light.spot | client | ✓ | ✓ | Frustum-culled |
light.area | client | ✓ | ✓ | Frustum-culled |
particle.gpu | client | ✓ | ✓ | Frustum-culled |
particle.trail | client | ✓ | ✓ | Frustum-culled |
physics.rigid | client | server | ✓ | ✓ | Frustum-culled |
physics.static | client | server | ✓ | ✓ | Frustum-culled |
physics.character | client | server | ✓ | ✓ | Frustum-culled |
physics.animatable | client | server | ✓ | ✓ | Frustum-culled |
physics.vehicle | client | server | ✓ | ✓ | Frustum-culled |
physics.vehicle_wheel | client | server | ✓ | ✓ | Frustum-culled, follows its parent's dimension |
physics.area | client | server | — | ✓ | |
physics.collision_shape | client | server | ✓ | ✓ | Frustum-culled, follows its parent's dimension |
Examples
core.engine.iprint(core.engine.get_entities("core.image"))core.engine.print("info", "Total webviews:", #core.engine.get_entities("core.webview"))core.engine.print("info", "Streamed models:", #core.engine.get_entities("core.model", true))core.engine.print("info", "Streamed point lights:", #core.engine.get_entities("light.point", true))