Class World

Stores entities and provides entity groups for organization and queries.

class World
  : dlib.core.ownership.Owner;

Constructors

NameDescription
this (owner) Constructs a new world and initializes entity groups.

Fields

NameTypeDescription
areaLights EntityGroupAreaLightsGroup of area and spot lights.
background EntityGroupBackgroundGroup of background entities.
decals EntityGroupDecalsGroup of decal entities.
entities dlib.container.array.Array!(dagon.graphics.entity.Entity,32L)Array of all entities in the world.
foreground EntityGroupForegroundGroup of foreground entities.
lights EntityGroupLightsGroup of all light entities.
prevRootTransformation dlib.math.matrix.Matrix!(float,4L)Previous frame's root transformation.
probes EntityGroupProbesGroup of probe entities.
rootInvTransformation dlib.math.matrix.Matrix!(float,4L)Inverse of the root transformation.
rootTransformation dlib.math.matrix.Matrix!(float,4L)Root transformation matrix for all entities.
spatial EntityGroupSpatialGroup of all spatial entities.
spatialOpaqueDynamic EntityGroupSpatialOpaqueGroup of dynamic opaque spatial entities.
spatialOpaqueStatic EntityGroupSpatialOpaqueGroup of static opaque spatial entities.
spatialTransparent EntityGroupSpatialTransparentGroup of transparent spatial entities.
sunLights EntityGroupSunLightsGroup of sun (directional) lights.
visible boolIf false, the world and its entities are hidden.

Methods

NameDescription
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.