@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.

    Index

    Constructors

    Properties

    Accessors

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

    Methods

    Constructors

    Properties

    postRenderFunc: () => void

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

    preRenderFunc: () => void

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

    Accessors

    • get _textureLoadFunc(): (id: number, code: number) => void

      Internal. Get Optional texture loading func.

      Returns (id: number, code: number) => void

    • get bridge(): Bridge

      Bridge

      Returns Bridge

    • get canvas(): HTMLCanvasElement

      Returns HTMLCanvasElement

    • get Entity(): RuntimeEntity

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

      Returns RuntimeEntity

    • 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

      Gets Height of canvas

      Returns number

    • get logger(): Logger

      Internal: Get logging instance

      Returns Logger

    • get module(): unknown

      WASM module, really IWASMmodule

      Returns unknown

    • get notifications(): Notifications

      Get notification manager that handles component notifications.

      Returns Notifications

    • get scene(): Scene

      Returns Scene

    • 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

      Gets Width of canvas

      Returns number

    Methods

    • 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.

    • 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.

      • Optionalflags: AssetLoadFlags

        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.

      • Optionalflags: AssetLoadFlags

        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

      • Optionalflags: AssetLoadFlags

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

      Returns boolean

      true if success

    • Resize drawing area

      Parameters

      • x: number
      • y: number

      Returns void

    • Internal: 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