# Interface CSS3DPluginController

plugin 的基本控制器

interface CSS3DPluginController {
cacheMap: WeakMap<object, any>;
camera: PerspectiveCamera;
data?: any;
five: Five;
hooks: Subscribe<CSS3DPluginType.EventMap>;
renderer: CSS3DRenderer;
scene: Scene;
state: CSS3DPluginType.State;
staticPrefix: string;
styleSheet: CSSStyleSheet;
absoluteUrl(url: string): string;
add(...object: Object3D[]): void;
appendTo?(wrapper: Element): void;
appendToFiveContainer(): void;
createCSS3DObject(__namedParameters: CreateCSS3DObjectType): CSS3DObject;
disable(options?: BaseOptions): void;
dispose(): void;
enable(options?: BaseOptions): void;
fadeInObjects(...objects: Object3D[]): void;
fadeOutObjects(...objects: Object3D[]): void;
forceRender(): void;
getCurrentState(): CSS3DPluginType.State;
hide(options?: BaseOptions): void;
load(data: any): Promise<void>;
remove(object: Object3D): void;
removeAll(): void;
render(): void;
setState?(state: Partial<PluginState>, options?: BaseOptions): void;
show(options?: BaseOptions): void;
}

#### Hierarchy (View Summary)

- Controller<
  CSS3DPluginType.State,
  CSS3DPluginType.EventMap,
  CSS3DPluginType.ServerData,
  CSS3DPluginType.PluginData,
  >
  - CSS3DPluginController

- Defined in lib/plugins/CSS3DPlugin/Controller.ts:9

##### Index

### Properties

cacheMap
camera
data?
five
hooks
renderer
scene
state
staticPrefix
styleSheet

### Methods

absoluteUrl
add
appendTo?
appendToFiveContainer
createCSS3DObject
disable
dispose
enable
fadeInObjects
fadeOutObjects
forceRender
getCurrentState
hide
load
remove
removeAll
render
setState?
show

## Properties

### cacheMap

cacheMap: WeakMap<object, any> = ...

- Defined in lib/plugins/CSS3DPlugin/Controller.ts:22

### camera

camera: PerspectiveCamera = ...

- Defined in lib/plugins/CSS3DPlugin/Controller.ts:21

### `Optional` data

data?: any

当前使用的数据

Overrides BasePlugin.Controller.data

- Defined in lib/plugins/CSS3DPlugin/Controller.ts:12

### five

five: Five

Inherited from Controller.five

- Defined in lib/plugins/BasePlugin/index.ts:68

### hooks

hooks: Subscribe<CSS3DPluginType.EventMap> = ...

#### Description

插件事件钩子

Inherited from Controller.hooks

- Defined in lib/plugins/BasePlugin/index.ts:82

### renderer

renderer: CSS3DRenderer

CSS3D 渲染器实例

- Defined in lib/plugins/CSS3DPlugin/Controller.ts:18

### scene

scene: Scene = ...

- Defined in lib/plugins/CSS3DPlugin/Controller.ts:19

### state

state: CSS3DPluginType.State

插件当前状态

Overrides Controller.state

- Defined in lib/plugins/CSS3DPlugin/Controller.ts:15

### `Readonly` staticPrefix

staticPrefix: string = '//vr-image-4.realsee-cdn.cn'

Inherited from Controller.staticPrefix

- Defined in lib/plugins/BasePlugin/index.ts:84

### styleSheet

styleSheet: CSSStyleSheet = ...

- Defined in lib/plugins/CSS3DPlugin/Controller.ts:20

## Methods

### absoluteUrl

- absoluteUrl(url: string): string

  #### Parameters

  - url: string

  #### Returns string

  #### Description

  获取静态资源的url

  Inherited from Controller.absoluteUrl

  - Defined in lib/plugins/BasePlugin/index.ts:135

### add

- add(...object: Object3D[]): void

  #### Parameters

  - ...object: Object3D[]

  #### Returns void

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:175

### `Optional` appendTo

- appendTo?(wrapper: Element): void

  插件自身DOM添加到父容器

  #### Parameters

  - wrapper: Element

    Element元素

  #### Returns void

  Inherited from Controller.appendTo

  - Defined in lib/plugins/BasePlugin/index.ts:113

### appendToFiveContainer

- appendToFiveContainer(): void

  将插件 DOM 挂载到指定容器

  #### Returns void

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:147

### createCSS3DObject

- createCSS3DObject(__namedParameters: CreateCSS3DObjectType): CSS3DObject

  #### Parameters

  - __namedParameters: CreateCSS3DObjectType

  #### Returns CSS3DObject

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:66

### disable

- disable(options?: BaseOptions): void

  禁用插件，让插件停止响应交互

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void

  Overrides Controller.disable

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:243

### dispose

- dispose(): void

  销毁插件，移除所有副作用

  #### Returns void

  Overrides Controller.dispose

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:267

### enable

- enable(options?: BaseOptions): void

  启用插件，让插件能够响应交互

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void

  Overrides Controller.enable

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:234

### fadeInObjects

- fadeInObjects(...objects: Object3D[]): void

  淡入指定的 CSS3DObject，设置 object.userData.visible = true

  #### Parameters

  - ...objects: Object3D[]

  #### Returns void

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:201

### fadeOutObjects

- fadeOutObjects(...objects: Object3D[]): void

  淡出指定的 CSS3DObject，设置 object.userData.visible = false

  #### Parameters

  - ...objects: Object3D[]

  #### Returns void

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:211

### forceRender

- forceRender(): void

  强制标脏并重新渲染所有 objects

  #### Returns void

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:129

### getCurrentState

- getCurrentState(): CSS3DPluginType.State

  获取当前的插件状态，如果当初插件内存在需要通过动画变更的 state 值，则通过此方法可以得到中间状态

  #### Returns CSS3DPluginType.State

  Inherited from Controller.getCurrentState

  - Defined in lib/plugins/BasePlugin/index.ts:105

### hide

- hide(options?: BaseOptions): void

  隐藏场景，设置 scene.visible = false

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void

  Overrides Controller.hide

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:261

### load

- load(data: any): Promise<void>

  加载插件依赖数据

  #### Parameters

  - data: any

  #### Returns Promise<void>

  Overrides Controller.load

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:64

### remove

- remove(object: Object3D): void

  #### Parameters

  - object: Object3D

  #### Returns void

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:181

### removeAll

- removeAll(): void

  #### Returns void

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:192

### render

- render(): void

  #### Returns void

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:117

### `Optional` setState

- setState?(state: Partial<PluginState>, options?: BaseOptions): void

  设置state

  #### Parameters

  - state: Partial<PluginState>

    插件的目标状态

  - `Optional` options: BaseOptions

    配置项

  #### Returns void

  Inherited from Controller.setState

  - Defined in lib/plugins/BasePlugin/index.ts:130

### show

- show(options?: BaseOptions): void

  显示场景，设置 scene.visible = true

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void

  Overrides Controller.show

  - Defined in lib/plugins/CSS3DPlugin/Controller.ts:252