Class: Entity

Entity

Entity represents a node in the Scene graph that can have Component objects added to it, which can define its behavior in a modular way.


new Entity()

Properties:
Name Type Description
components Array

The components added to this Entity. They are accessible as properties with the name they were given when registered with HX.Component.register(name, componentType). For example: entity.components.meshInstance contains the array of all MeshInstance components.

worldBounds BoundingVolume

The bounding volume for this entity in world coordinates. This does not include children.

static boolean

Whether or not this Entity can move or not.

messenger Messenger

The Messenger to which elements can listen for certain names Signals related to this Entity.

Author:
  • derschmale <http://www.derschmale.com>

Methods


_bindSkeleton()


addComponent()

Adds a single Component object to the Entity.


addComponents(components)

Adds multiple Component objects to the Entity.

Parameters:
Name Type Description
components Array

An array of components to add.


clone()


destroy()


getComponentByName()

Returns the Component with a given name.


invalidateBounds()

Marks the bounds as invalid, causing them to be recalculated when next queried.


removeComponent()

Removes a single Component from the Entity.


removeComponents(components)

Removes multiple Component objects from the Entity.

Parameters:
Name Type Description
components Array

A list of components to remove.