UNPKG

@shopware-ag/dive

Version:

Shopware Spatial Framework

81 lines (80 loc) 2.38 kB
import { DIVEClock } from './clock/Clock.ts'; import { DIVEView } from './view/View.ts'; import { DIVEScene, DIVESceneSettings } from './scene/Scene.ts'; import { DIVEPerspectiveCameraSettings } from './camera/PerspectiveCamera.ts'; import { DIVERendererSettings } from './renderer/Renderer.ts'; import { OrbitControllerSettings } from '../plugins/orbitcontroller/index.ts'; declare global { interface Window { DIVE: { /** * All instances of DIVE */ instances: DIVE[]; /** * Get the first instance of DIVE */ get instance(): DIVE | undefined; }; } } export type DIVESettings = { /** * Whether the engine should start automatically after initialization. * * @default true */ autoStart: boolean; /** * Whether to display coordinate axes in the scene. * * @default false */ displayAxes: boolean; } & DIVESceneSettings & DIVEPerspectiveCameraSettings & DIVERendererSettings & OrbitControllerSettings; export declare const DIVEDefaultSettings: Required<DIVESettings>; /** * #### DIVE * is the main class of the DIVE framework. * * An instance of this class delivers a complete 3D environment with a perspective camera, orbit controls, a toolbox, and a communication system. * ```ts * import { DIVE } from "@shopware-ag/dive"; * * const myWrapper = document.getElementById('myWrapper'); * * const dive = new DIVE(); * * myWrapper.appendChild(dive.Canvas); * * dive.Communication.subscribe('GET_ALL_SCENE_DATA', () => { * // do something * })); * * dive.Communication.performAction('GET_ALL_SCENE_DATA', {}); * ``` * @module */ export declare class DIVE { private _instanceId; private _settings; private _disposed; private _views; private _mainView; private _scene; private _clock; private _orientationDisplay; constructor(settings?: Partial<DIVESettings>); get views(): DIVEView[]; get mainView(): DIVEView; get canvas(): HTMLCanvasElement; get scene(): DIVEScene; get clock(): DIVEClock; /** * @deprecated Use startAsync() instead, which returns a promise that resolves when the engine is fully initialized. */ start(): void; startAsync(): Promise<void>; stop(): void; disposeAsync(): Promise<void>; }