A structure element of the scene.

To construct a scene, you should form a hierarchy of entities to create its structure, then add different components such as lights, cameras, and geometry to entities to create visible content.

Each entity has a name which could be used for finding the entity in a hierarchy.

Entities in the scene form a tree hierarchy between parents and children.

Each entity could be in an enabled or disabled state. The disabling of the entity is equivalent to removing the entity and all its children from the hierarchy.

An entity is a container for components. Each entity could contain several components, but only one component of each component type. The Transform component is mandatory and it implicitly placed in each entity.

Hierarchy

  • Entity

Methods

  • add entiy as child to hierarchy

    Parameters

    Returns void

  • add given component to entity if component of given type wasn't added before.

    Parameters

    Returns void

  • Add entity for given layer if it is wasn't added before.

    Parameters

    • layer: Layer

      layer to add.

    Returns void

  • remove all child entites list.

    Returns void

  • Perform depth-first traverse of entity tree. Return first found child with name entityName or NULL if such an entity doesn't exist.

    Parameters

    • entityName: string

      name of desired entity

    Returns Entity

    found entity or null

  • get all child entites list.

    Returns Vector<Entity>

  • Returns Vector<Layer>

    list of layers in which entity was added.

  • Returns string

    entity name

  • Returns Entity

    parent entity and null if given entity is root.

  • check if component of given type was added.

    Parameters

    Returns boolean

    flag

  • Returns boolean

    activity flag

  • remove entiy as child to hierarchy

    Parameters

    Returns void

  • remove given component to entity if component of given component was added before.

    Parameters

    Returns void

  • Removes entity from given layer if it is was added before.

    Parameters

    • layer: Layer

      layer to remove from.

    Returns void

  • Set enable/disable entity flag. The disabling of the entity is equivalent to removing the entity and all its children from the hierarchy.

    Parameters

    • active: boolean

      activity flag.

    Returns void

  • Set a new name to the entity. Name could be empty.

    Parameters

    • name: string

      new entity name.

    Returns void