Class World
Stores entities and provides entity groups for organization and queries.
class World
: dlib .core .ownership .Owner;
Constructors
| Name | Description |
|---|---|
this
(owner)
|
Constructs a new world and initializes entity groups. |
Fields
| Name | Type | Description |
|---|---|---|
areaLights
|
EntityGroupAreaLights | Group of area and spot lights. |
background
|
EntityGroupBackground | Group of background entities. |
decals
|
EntityGroupDecals | Group of decal entities. |
entities
|
dlib | Array of all entities in the world. |
foreground
|
EntityGroupForeground | Group of foreground entities. |
lights
|
EntityGroupLights | Group of all light entities. |
prevRootTransformation
|
dlib | Previous frame's root transformation. |
probes
|
EntityGroupProbes | Group of probe entities. |
rootInvTransformation
|
dlib | Inverse of the root transformation. |
rootTransformation
|
dlib | Root transformation matrix for all entities. |
spatial
|
EntityGroupSpatial | Group of all spatial entities. |
spatialOpaqueDynamic
|
EntityGroupSpatialOpaque | Group of dynamic opaque spatial entities. |
spatialOpaqueStatic
|
EntityGroupSpatialOpaque | Group of static opaque spatial entities. |
spatialTransparent
|
EntityGroupSpatialTransparent | Group of transparent spatial entities. |
sunLights
|
EntityGroupSunLights | Group of sun (directional) lights. |
visible
|
bool | If false, the world and its entities are hidden. |
Methods
| Name | Description |
|---|---|
add
(entity)
|
Adds an existing entity to the world. |
addEntity
(parent)
|
Creates and adds a new entity, optionally with a parent. |
createEntityGroups
()
|
Creates and initializes all entity groups. |
length
()
|
Returns the number of entities in the world. |
opApply
(dg)
|
Iterates over all entities (by index and reference). |
opApply
(dg)
|
Iterates over all entities (by reference only). |
opApplyReverse
(dg)
|
Iterates in reverse order (by index and reference). |
opApplyReverse
(dg)
|
Iterates in reverse order (by reference only). |
remove
(entity)
|
|
resetTransformation
()
|
Resets the root transformation matrices. |