@kognifai/cogsengine
    Preparing search index...

    Class CurtainView

    Entity in Extension CurtainView

    Hierarchy (View Summary)

    Index

    Constructors

    • Internal

      Internal: Initializes a new instance of the Entity class

      Parameters

      • id: number

        Entity Id

      • type: string

        Entity type, e.g. "Cube", "Sphere",.. undefined if not looked up

      • name: string

        Entity name. undefined if not looked up

      • runtime: Runtime

        Class runtime

      Returns CurtainView

    Accessors

    • get id(): number

      Gets the Cogs EntityID of the Entity

      Returns number

    • set id(value: number): void
      Internal

      Internal set ID: Called when destroying entity

      Parameters

      • value: number

      Returns void

    • get meshComponent(): MeshComponent

      Contains a handle to a Mesh resource to use when rendering using the MeshRenderComponent.

      Returns MeshComponent

    • 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 sceneComponent(): SceneComponent

      Contains information on how the entity behaves in the scene.

      Returns SceneComponent

    • get transformComponent(): TransformComponent

      Defines a 4x4 transformation matrix for the entity and a global offset for root entities.

      Returns TransformComponent

    • 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

    • Internal

      Internal: Create a new entity of given Entity type, optional name

      Parameters

      • runtime: Runtime
      • bridge: Bridge
      • type: string
      • Optionalname: string

      Returns Entity

    • Internal

      Internal: Gets entity of given type with name name. Name lookup is global, type is checked.

      Parameters

      • runtime: Runtime
      • bridge: Bridge
      • name: string
      • type: string

      Returns Entity

    • Internal

      Wrap an existing entity with given EntityId

      Parameters

      • runtime: Runtime
      • bridge: Bridge
      • id: number

      Returns Entity