@kognifai/cogsengine
    Preparing search index...

    Class InstancedMeshBuilderComponent

    Builds instance matrices from position, rotation and scale, and can dynamically scale instances to appear fixed sized on screen. Manages the instance mesh of the InstancedMeshRenderComponent of the same entity. Enables/disables relevant material instance variants.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    colors: Float32Array

    (Contents: vec4[]) Per-instance colors, either empty or size matching the other array attributes.

    fixedSize: boolean

    If set, instances are dynamically scaled s.t. they appear fixed sized on screen regardles of distance from camera, the instance size is expected to be dpi-scaled pixels.

    fixedSizeMaxDistance: number

    Culling camera-distance when fixedSize is enabled. Disable by setting it to zero or negative value.

    isTyped: boolean = false

    Internal flag set if component is a Cogs Core component.

    positions: Float32Array

    (Contents: vec3[]) Per-instance positions, either empty or size matching the other array attributes.

    rotations: Float32Array

    Per-instance rotations, either empty or size matching the other array attributes.

    scales: Float32Array

    (Contents: vec3[]) Per-instance scale factors, either empty or size matching the other array attributes.

    Accessors

    • get entity(): Entity | null

      Gets the optional owning entity

      Returns Entity | null

    • set entity(entity: Entity | null): void

      Internal: set owning entity.

      Parameters

      Returns void

    • get name(): string

      Component name == type. For compatibility

      Returns string

    • get type(): string

      Gets the type of the component. Ex. "TransformComponent", "SceneComponent" etc.

      Returns string

    Methods

    • Internal: Creates a new component of the given type (name). Component is wrapped when adding to an entity.

      Parameters

      • type: string

        Type of the component. Ex. "TransformComponent"

      Returns Component

      Created Cogs.js component.

    • Internal: Creates a new component being wrapped as an existing member of the entity

      Parameters

      • type: string

        Type of the component. Ex. "TransformComponent"

      • entity: Entity

        The owning entity

      Returns Component

      Created Cogs.js component.