@kognifai/cogsengine
    Preparing search index...

    Class Runtime

    Exposed as control.runtime

    The Runtime class is a main class in Cogs.js owning the Scene, Bridge, Resources etc.

    Entities and Components are exposed as data members on the runtime. Note: This definition is a static definition and members of extensions will not be available until the Extension is loaded.

    In the TypeScript interface to Cogsengine can drill down into each entity to find the components that it consists of. Components are reused across entities.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    AdaptivePlanarGridComponent AnnotationAxisComponent Asset AssetComponent AxisCube AxisCubeComponent AxisCubeEdge AxisCubeFace BadgeSet BadgeSetComponent BasicMeshGeneratorEntity BasicOcean BasicOceanComponent BasicTerrain BasicTerrainComponent Billboard BillboardComponent BoreHole bridge callbackManager Camera CameraArray CameraArrayComponent CameraComponent canvas Casing ClipShape ClipShapeComponent ClipShapeRefComponent componentHandler Cube CubeMarker CubeMarkerComponent CurtainView CurtainViewComponent Cylinder DataSet DataSet2D DataSet2DComponent DataSetComponent DepthAxis DepthAxisComponent DrillBit DrillingRiserFlexJoint DrillingRiserJoint DrillingRiserTelescopicJoint DrillingRiserTensioner Empty Entity entityHandler Environment EnvironmentComponent Extrusion ExtrusionComponent fieldAccessMap Fog FogComponent FontSelectorComponent FPSNavigationComponent generation GenericShape gl gl1 gl2 Group height HeightMap HeightMapComponent HighlightRegion HighlightRegionComponent Image360 Image360Component InstancedMeshPart InstancedMeshRenderComponent Light LightComponent LineShape Lod LodComponent LoftedCrossSectionsComponent logger logLevel LookupColorMap MarkerPointSet MarkerPointSetComponent MaterialComponent MeshComponent MeshGeneratorComponent MeshPart MeshPartWithMaterial MeshRenderComponent ModelComponent ModelEntity module MotionComponent MultiphaseFlow MultiphaseFlowComponent NearLimitComponent notifications OGC3DTiles OGC3DTilesComponent OrbitingCameraController OverlayComponent Plane PotreeComponent PotreeModel ProceduralSky ProceduralSkyComponent RadialLog RadialLogComponent RenderComponent Reservoir ReservoirGetCaseInfoComponent ReservoirSectionComponent resources RiserFlexJointComponent RiserJointComponent RiserTelescopicJointComponent RiserTensionerComponent scene SceneComponent ScreenSizeComponent SeaCurrents SeaCurrentsComponent settings ShapeComponent SkyDome Sphere SpriteRenderComponent SubMeshRenderComponent SwitchComponent taskManager TeleportNavigationComponent TensionRing TensionRingComponent TexAtlas TexAtlasComponent Text TextComponent TextureGeneratorComponent Trajectory TrajectoryAlignedComponent TrajectoryComponent TrajectoryCrossSectionsComponent TrajectoryCylinder TransformComponent TwinVisuals TwinVisualsComponent useWebGPU VariableExtrusionComponent VariableExtrusionShape VectorField VectorFieldComponent webGLRenderer webGLVendor webGLVersion Wellbore WellLog width WireCube ZipComponent

    Methods

    Constructors

    Properties

    _module: IWASMmodule = null
    entitiesById: EntityMapType = {}

    Entities by id. Only created entities should go here. Entities looked up created in Cogs.Core may be replaced by a new entity with same id.

    notifyChangeCallback?: () => void = undefined

    CogsInternal: Used for ContinuousRendering support

    postRenderFunc: VoidFunction = null

    CogsInternal: Do not use! Required for internal Cogs signaling Clients must use Control.addEventListener("postRender", e) to be notified after each render update.

    postSystemsUpdateFunc: VoidFunction = null

    CogsInternal: Do not use! Required for internal Cogs signaling Clients must use Control.addEventListener("postSystemsUpdate", e) to be notified before each render update.

    preRenderFunc: VoidFunction = null

    CogsInternal: Do not use! Required for internal Cogs signaling Clients must use Control.addEventListener("preRender", e) to be notified before each render update.

    preUpdateFunc: VoidFunction = null

    Accessors

    • get bridge(): Bridge

      Internal: Bridge

      Returns Bridge

    • get callbackManager(): CallbackManager

      Gets callback manager. CogsInternal usage only

      Returns CallbackManager

    • get canvas(): HTMLCanvasElement

      Returns HTMLCanvasElement

    • get Entity(): CogsRuntimeEntity

      Gets class containing 'wrap' method. To get complete entity description from EntityId using: runtime.Entity.wrap(id: EntityId);

      Returns CogsRuntimeEntity

    • get entityHandler(): EntityHandler

      CogsInternal:

      Returns EntityHandler

    • get fieldAccessMap(): FieldAccessMap

      CogsInternal: Field lookup map.

      Returns FieldAccessMap

    • get generation(): number

      Unique identifies a Runtime instance. Changed each time the context is reset or shut down. Can be used for async operations to detect if the Runtime is still valid. Can be used by client Resource loader to check if a resource has been loaded on a Runtime (Shader, Custom material etc) instead of keeping a reference to the runtime.

      Returns number

    • get gl(): WebGLRenderingContext | WebGL2RenderingContext

      CogsInternal: Gets WebGL1 and WebGL2 common interface

      Returns WebGLRenderingContext | WebGL2RenderingContext

    • get gl1(): WebGLRenderingContext

      CogsInternal: Gets WebGLRenderingContext. Requires webGLVersion === 1. Throws if invalid usage.

      Returns WebGLRenderingContext

    • get gl2(): WebGL2RenderingContext

      CogsInternal: Gets WebGL2RenderingContext. Requires webGLVersion === 1 Throws if invalid usage.

      Returns WebGL2RenderingContext

    • get height(): number

      Height of canvas

      Returns number

    • get logger(): Logger

      Gets logging module. CogsInternal usage only

      Returns Logger

    • get module(): IWASMmodule

      Gets typed WASM module

      Returns IWASMmodule

    • get notifications(): Notifications

      Get notification manager that handles component notifications.

      Returns Notifications

    • get scene(): Scene

      Returns Scene

    • get taskManager(): TaskManager

      Internal: Manages decompression of ArrayBuffers in web workers.

      Returns TaskManager

    • get useWebGPU(): boolean

      Using WebGPU insead of WebGL.

      Returns boolean

    • get webGLRenderer(): string

      The WebGL renderer string if it was exposed.

      Returns string

    • get webGLVendor(): string

      The WebGL vendor string if it was exposed.

      Returns string

    • get webGLVersion(): number

      The actual version of the WebGL context, zero if there is no WebGL context.

      Returns number

    • get width(): number

      Width of canvas

      Returns number

    Methods

    • Parameters

      Returns void

    • Initialize type system when Cogs ready

      Returns void

    • Just abort everything, should be called when the wasm heap is in an indeterminate state like after an exception was emitted.

      Parameters

      • error: unknown

      Returns void

    • Clear all entities and set up new context

      Returns void

    • Remove entity from Cogs entity lookup table. Entity is destroyed if not in use by other entities.

      Parameters

      • entity: Entity

        Entity to remove.

      Returns void

    • Erase a Cogs config variable.

      Parameters

      • key: string

        Full name of the variable

      Returns boolean

      True if variable found.

    • Get a Cogs boolean config variable.

      Parameters

      • key: string

        Full name of the variable

      Returns boolean

      Variable value.

    • Get a Cogs number config variable.

      Parameters

      • key: string

        Full name of the variable

      Returns number

      Variable value.

    • Get miscellaneous resource statistics.

      To get more precise numbers on allocations, passing 'malinfo': 1 in options invokes calling of malinfo that traverses the malloc allocation structures. This might be costly, so we have this as opt-in for now.

      Parameters

      • Optionaloptions: { malinfo?: boolean }

      Returns IResourceStatistics

    • Get a Cogs config variable.

      Parameters

      • key: string

        Full name of the variable

      Returns string

      Variable value.

    • Check if a Cogs config variable exists.

      Parameters

      • key: string

        Full name of the variable

      Returns boolean

      True if Variable exists.

    • Called by class Control during setup

      Parameters

      Returns Promise<void>

    • Returns boolean

    • Load scene graph from Resource url. The resource must be registered as a string resource using Resources.registerStringResource.

      Parameters

      • path: string

        Resource url

      • parent: Entity

        Optional parent entity. Recommended for clean-up.

      • flags: AssetLoadFlags = AssetLoadFlags.NoDefault

        Optional Loading flags =AssetLoadFlags.NoDefault

      Returns boolean

      true if success

    • Load scene graph from JSON definition.

      Parameters

      • jsonDef: string

        Asset definition

      • parent: Entity

        Optional parent entity. Recommended for clean-up.

      • flags: AssetLoadFlags = AssetLoadFlags.NoDefault

        Optional Loading flags =AssetLoadFlags.NoDefault

      Returns boolean

      true if success

    • Adds a new extension (e.g. Physics, Potree etc), returns true if extension found and loaded

      Parameters

      • extensionName: string

      Returns boolean

    • Load scene graph from Resource url The resource must be registered as a string resource using Resources.registerStringResource.

      Parameters

      • path: string

        Resource url

      • flags: AssetLoadFlags = AssetLoadFlags.NoDefault

        Loading flags. AssetLoadFlags.ClearScene can be used to clear scene contents. =AssetLoadFlags.NoDefault

      Returns boolean

      true if success

    • Returns boolean

    • Internal release of JS and WASM resources closing down this instance of Cogs.js

      Returns void

    • Parameters

      • forceOpaque: boolean = false

      Returns number

    • Reset counters for frame timings provided by \ref getResourceStatistics.

      Returns void

    • Resize drawing area

      Parameters

      • x: number
      • y: number

      Returns void

    • set DPI and scalingFactor

      Parameters

      • dpi: number
      • scaleFactor: number

      Returns void

    • Set a Cogs config variable. Internally sent as string. Use getVariable/getBoolVariable/getDoubleVariable to get variable value.

      Parameters

      • key: string

        Full name of the variable

      • value: string | number | boolean

        New variable value.

      Returns void