@kognifai/cogsengine
    Preparing search index...

    Class InstancedMeshRenderComponent

    Renders a mesh using instancing.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    drawOrder: number

    Draw order within a render bucke. Useful to control transparency overdraw. This value will be overriden by the material's draworder if that is nonzero.

    instanceCount: number

    Instance count. uint32_t(-1) to draw all remaining instances.

    instanceIdMultiplier: number

    Multiplier used when embedding instance ids into picking results. If geometry mesh texcoord ids run in [0, N), setting multiplier to N will stack the ids of the instances on top of eachother. Set to zero to disable embedding of instance ids.

    instanceMesh: Mesh | null

    Mesh containing instancing data. If mesh contains instance matrices, it is assumed these are regular transform matrices and will be used for bounds calculation and picking. If mesh contains instance positions, but not instance matrices, those will be used instead. If the mesh contains bounds, those bounds are used instead of calculating bounds from matrix/positions. These bounds are extended by the bounds by the geometry mesh. For picking/bounds to work, the vertex shader has to do normal transform. If the vertex shader does not do that, use custom picking and set the bounds.

    isTyped: boolean = false

    Internal flag set if component is a Cogs Core component.

    Layer mask used to determine visibility for a given camera viewport. The layer mask is combined with that of the camera. The resulting value can then be combined with the result of isVisible() to form a final visibility value.

    material: MaterialInstance | null

    Material instance used to render the mesh.

    objectId: number

    Object identifier passed to rendering commands.

    primitiveType: PrimitiveType

    Primitive type to use when drawing. Default value -1 means use primitive type from mesh.

    renderFlags: RenderFlags

    Render flags used to control rendering behavior.

    startIndex: number

    Start vertex index to render from.

    startInstance: number

    Start instance.

    vertexCount: number

    Number of vertexes to draw. uint32_t(-1) to draw all remaining vertices.

    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.