@realsee/five
Version:
Realsee Renderer SDK
60 lines (59 loc) • 1.92 kB
TypeScript
import type { Five } from '@realsee/five';
import { BasePlugin } from '../BasePlugin';
import * as THREE from 'three';
import { CSS2DRenderer, CSS2DObject } from '../thirdParty/CSS2DRenderer.js';
import type * as PluginType from './typing';
export declare class Controller extends BasePlugin.Controller<PluginType.State, PluginType.EventMap, PluginType.ServerData, PluginType.PluginData> {
/** 当前使用的数据 */
data?: PluginType.PluginData;
/** 插件当前状态 */
state: PluginType.State;
/** CSS2D 渲染器实例 */
renderer: CSS2DRenderer;
scene: THREE.Scene;
styleSheet: CSSStyleSheet;
camera: THREE.PerspectiveCamera;
private resizeObserver?;
private updateState;
constructor(five: Five, params?: PluginType.Params);
load(data: PluginType.ServerData): Promise<void>;
createCSS2DObject: ({ id, name, innerHTML, center, position, visible, timeout, }: PluginType.CreateCSS2DObjectType) => CSS2DObject;
render: () => void;
private _addEventListener;
private _removeEventListener;
/**
* 将插件 DOM 挂载到指定容器
*/
appendToFiveContainer(): void;
add(...object: THREE.Object3D[]): void;
remove(object: THREE.Object3D): void;
removeAll(): void;
/**
* 淡入指定的 CSS2DObject
*/
fadeInObjects(...objects: THREE.Object3D[]): void;
/**
* 淡出指定的 CSS2DObject
*/
fadeOutObjects(...objects: THREE.Object3D[]): void;
private _enable;
private _disable;
/**
* 启用插件
*/
enable(options?: BasePlugin.BaseOptions): void;
/**
* 禁用插件
*/
disable(options?: BasePlugin.BaseOptions): void;
/**
* 显示场景
*/
show(options?: BasePlugin.BaseOptions): void;
/**
* 隐藏场景
*/
hide(options?: BasePlugin.BaseOptions): void;
/** 销毁插件 */
dispose: () => void;
}