@kognifai/cogsengine
    Preparing search index...

    Class AssetComponent

    Instantiates an asset model into the scene. see Documentation/AssetSystem.md TODO: Investigate resource usage tolerance scaling. TODO: The tolerance should also be scaled by effective window size.

    Hierarchy (View Summary)

    Index

    Constructors

    • Internal: Component constructor

      Parameters

      • type: string

        type of the component. Ex. "TransformComponent"

      • entity: Entity

        Owning entity. Entity only passed when wrapping existing entity.

      Returns AssetComponent

    Properties

    Asset resource that should be instantiated.

    flags: AssetFlags

    Flags to control behaviour of asset instantiation.

    forceTolerance: boolean

    Disable adjustment of tolerance due to quality system or resource usage.

    freezeLod: boolean

    Temporarily disable adjustment of target lod-level, debug tool to allow moving the camera without affecting lod levels.

    idRanges: Uint32Array
    isTyped: boolean

    Internal flag set if component is a Cogs Core component.

    Material to use for models if the OverrideMaterial flag is set.

    minDistance: number

    Minimum distance to use when scaling the tolerance.

    priority: number

    Used to sort requests, higher number gets processed before lower number.

    tolerance: number

    Tolerance scale factor to use when determining lod levels, see AssetComponent's documentation.

    Accessors

    • get entity(): Entity

      Gets the optional owning entity

      Returns Entity

    • set entity(entity: Entity): 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.