Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Entity

Index

Constructors

  • new Entity(__namedParameters: { name: string; scene?: Scene; tag?: string }): Entity
  • Class constructor.

    Parameters

    • __namedParameters: { name: string; scene?: Scene; tag?: string }
      • name: string
      • Optional scene?: Scene
      • Optional tag?: string

    Returns Entity

Properties

_behaviours: IBehaviour[] = ...
_children: Entity[] = ...
_components: IComponent[] = ...
_id: string
_isAlive: boolean = true
_isLoaded: boolean = false
_isVisible: boolean = true
_localMatrix: Matrix4 = ...
_name: string
_parent: undefined | Entity
_scene: undefined | Scene
_tag: string
_worldMatrix: Matrix4 = ...
transform: Transform = ...

Accessors

  • get id(): string
  • get isAlive(): boolean
  • set isAlive(value: boolean): void
  • Gets if the object is alive.

    Returns boolean

    boolean

  • Sets if the object is alive.

    Parameters

    • value: boolean

    Returns void

    boolean

  • get isLoaded(): boolean
  • get isVisible(): boolean
  • set isVisible(value: boolean): void
  • Gets if the object is visible.

    Returns boolean

    boolean

  • Sets if the object is visible.

    Parameters

    • value: boolean

    Returns void

  • get name(): string
  • get parent(): undefined | Entity
  • Gets the parent object of the entity or undefined if no parent.

    Returns undefined | Entity

    Entity

Methods

  • destroy(): void
  • die(): void
  • Kills the entity, components, behaviours and children recursively.

    Returns void

    void

  • getBehaviourByName(name: string): undefined | IBehaviour
  • getComponentByName(name: string): undefined | IComponent
  • getObjectByName(name: string): undefined | Entity
  • Gets the child entity by name from the entity.

    Parameters

    • name: string

    Returns undefined | Entity

    Entity

  • load(): void
  • onAdded(scene: Scene): void
  • removeChild(child: Entity): void
  • Removes the child entity from the entity. //REVIEW: change this to by name?

    Parameters

    Returns void

    void

  • removeComponent(name: string): void
  • Removes the component by name.

    Parameters

    • name: string

    Returns void

    void

  • Renders the entity, components and all children recursively.

    Parameters

    Returns void

    void

  • unsubscribeAll(): void
  • Unsubscribe the components, behaviours and children from all message types.

    Returns void

    void

  • update(delta: number): void
  • Updates the entity by delta and recursively called on components, behaviours and children.

    Parameters

    • delta: number

    Returns void

    void

  • updateReady(): void
  • Checks if the components, behaviours and children is ready.

    Returns void

    void

  • updateWorldMatrix(parentWorldMatrix: undefined | Matrix4): void
  • Updates the world matrix based on the parent matrix and the local matrix.

    Parameters

    • parentWorldMatrix: undefined | Matrix4

    Returns void

    void

Generated using TypeDoc