@kognifai/cogsengine
    Preparing search index...

    Interface ControlSettings

    Parameters to

    Control.create() for Cogs initialization

    interface ControlSettings {
        alpha?: boolean;
        assetLoadCallback?: (id: number, code: number) => void;
        bufferLoadCallback?: (id: number, code: number) => void;
        canvas?: HTMLCanvasElement;
        continuousRendering?: boolean;
        decompressionMaxConcurrency?: number;
        distPath?: string;
        effectLoadCallback?: (id: number, code: number) => void;
        extensions: string[];
        fetchHandler?: IFetchHandler | FetchHandler;
        fontLoadCallback?: (id: number, code: number) => void;
        forceOpaque?: boolean;
        image360Callback?: (
            entityId: number,
            message: Image360Notification,
        ) => void;
        locateFile?: (path: string, prefix: string) => string;
        logCallback?: (
            message: string,
            source: string,
            category: LogCategory,
        ) => void;
        logLevel?: LogCategory;
        materialInstanceLoadCallback?: (id: number, code: number) => void;
        materialLoadCallback?: (id: number, code: number) => void;
        meshLoadCallback?: (id: number, code: number) => void;
        modelLoadCallback?: (id: number, code: number) => void;
        ogc3DTilesCallback?: (
            entityId: number,
            message: OGC3DTilesNotification,
        ) => void;
        onInitialized?: (control: Control) => void;
        parent?: HTMLElement;
        potreeCallback?: (entityId: number, message: PotreeNotification) => void;
        print?: (msg: string) => void;
        printErr?: (msg: string) => void;
        progressElement?: HTMLElement;
        statusElement?: HTMLElement;
        textureLoadCallback?: (id: number, code: number) => void;
        totalMemory?: number;
        variables?: VariableMap;
        variant?: string;
        webgl?: number;
        xrEnable?: boolean;
        xrOverlay?: boolean;
    }
    Index

    Properties

    alpha?: boolean

    Optional flag for the enabled XR features (getContext("webgl", attributes)

    assetLoadCallback?: (id: number, code: number) => void

    Optional callback invoked when Asset resource finished loading. Id = Cogs.AssetResource Resource id, code = 0 Success, 1 = failure

    bufferLoadCallback?: (id: number, code: number) => void

    Optional callback invoked when Buffer resource finished loading. Id = Buffer Resource id, code = 0 Success, 1 = failure

    canvas?: HTMLCanvasElement

    Owning HTML5 Canvas for Cogs. Created by Cogs Control if not set here. To enable Keyboard input for Cogs Debug GUI. Set tabIndex Property for canvas. E.g. canvas.tabIndex = 1 or suitable for application.

    continuousRendering?: boolean

    Set to true to enable continuous updates

    decompressionMaxConcurrency?: number

    Optional override the max number of webworkers doing data decompression (Default = 2).

    distPath?: string

    Path to the Cogs.js distribution folder for runtime loading of wasm code and resources

    effectLoadCallback?: (id: number, code: number) => void

    Optional callback invoked when Effect resource finished loading. Id = Effect Resource id, code = 0 Success, 1 = failure

    extensions: string[]

    Declaration of extensions to enable for application. This is required for load-time dynamic linking. Applications should also use runtime.loadExtensionModule to make the dependency explicit. This is good in general for code understanding. In the future with runtime dynamic linking we can relax the requirement for declaring extensions at startup and the application should then still work.

    fetchHandler?: IFetchHandler | FetchHandler

    Optional override of how to handle data loading requests

    fontLoadCallback?: (id: number, code: number) => void

    Optional callback invoked when Font resource finished loading. Id = Font Resource id, code = 0 Success, 1 = failure

    forceOpaque?: boolean

    Clears the canvas alpha channel to opaque after rendering, useful as a temporary quick-fix but might have a performance impact.

    image360Callback?: (entityId: number, message: Image360Notification) => void

    Optional callback From Image360Component.

    locateFile?: (path: string, prefix: string) => string

    CogsInternal locateFile callback. initialized in by cogs. This is put onto the emscripten module object, see.

    logCallback?: (message: string, source: string, category: LogCategory) => void

    Optional log callback.

    logLevel?: LogCategory

    Optional log level.

    materialInstanceLoadCallback?: (id: number, code: number) => void

    Optional callback invoked when MaterialInstance resource finished loading. Id = Cogs.MaterialInstance Resource id, code = 0 Success, 1 = failure

    materialLoadCallback?: (id: number, code: number) => void

    Optional callback invoked when Material resource finished loading. Id = Cogs.MaterialResource Resource id, code = 0 Success, 1 = failure

    meshLoadCallback?: (id: number, code: number) => void

    Optional callback invoked when Mesh resource finished loading. Id = Cogs.Mesh Resource id, code = 0 Success, 1 = failure

    modelLoadCallback?: (id: number, code: number) => void

    Optional callback invoked when Model resource finished loading. Id = Cogs.ModelResource Resource id, code = 0 Success, 1 = failure

    ogc3DTilesCallback?: (entityId: number, message: OGC3DTilesNotification) => void

    Optional notification callback for OGC3DTilesComponent.

    onInitialized?: (control: Control) => void

    Optional callback when Cogs initialized.

    parent?: HTMLElement

    Optional explicit setting of Control.parentElement. If not set the canvas is used as parentElement

    potreeCallback?: (entityId: number, message: PotreeNotification) => void

    Optional notification callback for PotreeComponent.

    print?: (msg: string) => void

    Optional callback for processing stdout.

    printErr?: (msg: string) => void

    Optional callback for processing stderr.

    progressElement?: HTMLElement

    Optional GUI progressElement. Used to display Cogs status if both statusElement & progressElement set.

    <progress value="0" max="100" id="progress" hidden="hidden"></progress>
    options.progressElement: document.getElementById("progress")
    statusElement?: HTMLElement

    Optional GUI statusElement. Used to display Cogs status if both statusElement & progressElement set.

    <div id="status">Downloading...</div>
    options.statusElement: document.getElementById("status")
    textureLoadCallback?: (id: number, code: number) => void

    Optional callback invoked when Texture resource finished loading. Id = Cogs.TextureResource Resource id, code = 0 Success, 1 = failure

    totalMemory?: number

    Don't use this with ALLOW_MEMORY_GROWTH=1

    variables?: VariableMap

    Optional Advanced Variables to be passed to the Cogs WASM module.

    variant?: string

    Build variant to use. default is a limited set. set to 'sdk' for all extensions.

    webgl?: number

    Optional selection of WebGl version. 1 = old WebGL1, 2 = WebGL2 (Default)

    xrEnable?: boolean

    Optional flag to enable XR features

    xrOverlay?: boolean

    Optional flag to show a screen overlay triggering XR features