omega-game-engine
    Preparing search index...

    The base class for all entities within the engine. It manages a transform, a collection of behaviours, and the entity's state within a scene. *

    Hierarchy (View Summary)

    Indexable

    • [key: string]: any
    Index

    Constructors

    Properties

    _className: string
    _serializationIgnoreKeys: string[]
    _uuid: string
    active: boolean = true

    A flag indicating if the entity is active and should be updated. *

    behaviours: EntityBehaviour[] = []

    A collection of behaviours attached to the entity. * *

    destroyed: boolean = false

    A flag indicating if the entity has been destroyed. * *

    entityType: number = EntityType.STATIC

    The type of the entity (e.g., STATIC, DYNAMIC). *

    name: string = ''
    scene: Scene

    The scene to which this entity belongs. *

    show: boolean = true

    A flag indicating if the entity should be rendered. *

    tag: string = 'Entity'

    A tag used for identifying or grouping entities. *

    transform: Transform

    The transform component of the entity. *

    updateInEditor: boolean = false

    A flag to determine if the entity should update in the editor. *

    Accessors

    Methods

    • Destroys the entity, cleaning up all attached behaviours. *

      Returns void

    • Retrieves the first behaviour of a specific type from the collection. *

      Type Parameters

      Parameters

      • constructor: new (...args: any[]) => T

        The constructor function of the type to filter by. *

      Returns undefined | T

      • The first behaviour found of the specified type, or undefined if none is found.
    • Retrieves all behaviours of a specific type from the collection. *

      Type Parameters

      Parameters

      • constructor: new (...args: any[]) => T

        The constructor function of the type to filter by. *

      Returns T[]

      • An array of behaviours of the specified type.
    • Initializes the entity and all of its behaviours. *

      Returns void

    • Updates the entity and its behaviours. *

      Parameters

      • ellapsed: number

        The elapsed time in seconds since the last update. *

      Returns void

    • Creates a new SceneEntity instance with a given name and an optional transform.

      Parameters

      • Optionalname: string = 'Entity'

        The name of the new entity. *

      • Optionaltransform: Transform

        The transform for the entity. A new one is created if none is provided. *

      Returns SceneEntity

      • The newly created SceneEntity instance.