import { Camera, ColorRepresentation, Raycaster, Scene, Vector2, WebGLRenderer, WebGLRendererParameters } from 'three'; import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js'; import { RenderView, ViewParameters } from '../rendering/RenderView.js'; import { RaycasterSortComparer } from '../events/RaycasterManager.js'; /** * Configuration parameters for initializing the Main class. */ export interface MainParameters { /** Enable full-screen mode and automatic canvas resizing (default: true). */ fullscreen?: boolean; /** Display performance statistics (default: true). */ showStats?: boolean; /** Disable the context menu on right-click (default: true). */ disableContextMenu?: boolean; /** Default background color (default: 'black'). */ backgroundColor?: ColorRepresentation; /** Default background alpha (transparency) value (default: 1). */ backgroundAlpha?: number; /** Callback function executed for each frame. */ animate?: (delta: number, total: number) => void; /** Configuration parameters for the WebGLRenderer. Ignored if renderer is specified. */ rendererParameters?: WebGLRendererParameters; /** Enable cursor handling in the application (default: true). */ enableCursor?: boolean; /** Enable multitouch interactions (default: false). */ multitouch?: boolean; /** */ renderer?: WebGLRenderer; } /** * The `Main` class serves as the core component for managing a 3D application. * It provides configuration options and methods for setting up and controlling the application's behavior. */ export declare class Main { /** A static counter representing the number of animation frames elapsed. */ ticks: number; private _renderManager; private _interactionManager; private _animate; private _clock; /** * The WebGLRenderer instance used for rendering the 3D scene. */ get renderer(): WebGLRenderer; /** * An array of all RenderView instances managed by the application. * Lists all views created and managed by the application, each representing a separate viewport or scene. */ get views(): RenderView[]; /** * The currently active RenderView (activated by mouse position). */ get activeView(): RenderView; /** * The Scene associated with the currently active RenderView. */ get activeScene(): Scene; /** * The Camera associated with the currently active RenderView. */ get activeCamera(): Camera; /** * The EffectComposer (used for post-processing) associated with the currently active RenderView. */ get activeComposer(): EffectComposer; /** * Indicates whether to display performance statistics. * If set to true, statistics will be shown; otherwise, they will be hidden. */ get showStats(): boolean; set showStats(value: boolean); /** * Indicates whether to enable multitouch interactions. */ get multitouch(): boolean; set multitouch(value: boolean); /** * Defines the mouse buttons that can be used for dragging objects. * Specify the button values as an array of PointerEvent button values. */ get dragButtons(): number[]; set dragButtons(value: number[]); /** * Indicates whether to enable cursor handling in the application. */ get enableCursor(): boolean; set enableCursor(value: boolean); /** * A custom sorting comparer function used to order intersections when performing raycasting. */ get raycasterSortComparer(): RaycasterSortComparer; set raycasterSortComparer(value: RaycasterSortComparer); /** * A Raycaster instance responsible for handling raycasting operations in the application. */ get raycaster(): Raycaster; /** * The default background color used in the application. */ get backgroundColor(): ColorRepresentation; set backgroundColor(value: ColorRepresentation); /** * The default alpha (transparency) value for the background. */ get backgroundAlpha(): number; set backgroundAlpha(value: number); /** * The current mouse position represented as a Vector2. * Provides the x and y coordinates of the mouse pointer within the application. */ get mousePosition(): Vector2; /** * Indicates if the pointer is over the canvas. */ get pointerOnCanvas(): boolean; /** * @param params Configuration parameters for initializing the Main class. */ constructor(params?: MainParameters); private setDefaultRendererParameters; private handleContextMenu; private setAnimationLoop; private clearAnimationLoop; animate(delta: number, total: number): void; /** * Creates a new RenderView and adds it to the RenderManager. * @param view The parameters for the new RenderView. * @returns The created RenderView instance. */ createView(view: ViewParameters): RenderView; /** * Adds a RenderView to the RenderManager. * @param view The RenderView instance to add. */ addView(view: RenderView): void; /** * Removes a RenderView from the RenderManager. * @param view The RenderView instance to remove. */ removeView(view: RenderView): void; /** * Removes a RenderView from the RenderManager by its tag. * @param tag The tag of the RenderView to remove. */ removeViewByTag(tag: string): void; /** * Clears all RenderViews from the RenderManager. */ clearViews(): void; /** * Retrieves a RenderView by its tag. * @param tag The tag to search for. * @returns The RenderView with the specified tag, if found, otherwise, undefined. */ getViewByTag(tag: string): RenderView; /** * Retrieves a RenderView by mouse position. * @param mouse The mouse position as a Vector2. */ getViewByMouse(mouse: Vector2): void; /** * Sets active RenderViews by tag. * @param tag The tag of the RenderViews to set as active. */ setActiveViewsByTag(tag: string): void; } //# sourceMappingURL=Main.d.ts.map