@kognifai/cogsengine
    Preparing search index...

    Class Entity

    Class storing a Cogs entity. Instances are created internally.

    Hierarchy (View Summary)

    Index

    Constructors

    • Returns Entity

    Accessors

    • get id(): number

      Gets the Cogs EntityID of the Entity

      Returns number

    • get name(): string

      Gets the Entity name. Empty string if not defined.

      Returns string

    • set name(value: string): void

      Sets the optional Entity name, renames existing entity

      Parameters

      • value: string

      Returns void

    • get type(): string

      Gets the Entity Type, g.g. 'Group', 'Cube' etc.

      Returns string

    Methods

    • Compare two entities for equality. Picking or wrapping entities are not guaranteed to return same object.

      Parameters

      • other: Entity

        Entity to compare with.

      Returns boolean

      True if same entity ID and belongs to same Cogs instance.

    • Get component of given type. Type param is deduced from parameter componentType. Must call: const xc = entity.getComponent(runtime.TransformComponent);

      Type Parameters

      • T extends Component

        Type returned. Not given. Calculated from the componentType parameter.

      Parameters

      Returns T

      actual component or null if not member.

    • CogsInternal: Release on Entity destroy.

      Returns void