Skip to main content

Class: GroundPlugin<TMesh>

Plugins.GroundPlugin

Type parameters​

NameType
TMeshextends Mesh<BufferGeometry, MeshStandardMaterial> | Reflector2 = Mesh<BufferGeometry, MeshStandardMaterial> | Reflector2

Hierarchy​

Implements​

Properties​

PluginType​

▪ Static Readonly PluginType: "Ground"


dependencies​

• dependencies: Class<IViewerPlugin<boolean>>[]

Implementation of​

IViewerPluginAsync.dependencies

Inherited from​

BaseGroundPlugin.dependencies


visible​

• visible: boolean = true

Inherited from​

BaseGroundPlugin.visible


size​

• size: number = 8

Inherited from​

BaseGroundPlugin.size


yOffset​

• yOffset: number = 0

Inherited from​

BaseGroundPlugin.yOffset


renderToDepth​

• renderToDepth: boolean = true

Inherited from​

BaseGroundPlugin.renderToDepth


tonemapGround​

• tonemapGround: boolean = true

Inherited from​

BaseGroundPlugin.tonemapGround


limitCameraAboveGround​

• limitCameraAboveGround: boolean = false

Inherited from​

BaseGroundPlugin.limitCameraAboveGround


enableRefreshTransform​

• enableRefreshTransform: boolean = true

Extra flag for plugins to disable transform refresh like when animating or dragging

Inherited from​

BaseGroundPlugin.enableRefreshTransform


useModelBounds​

• useModelBounds: boolean = false

Inherited from​

BaseGroundPlugin.useModelBounds


bakedShadows​

• bakedShadows: boolean = true


groundReflection​

• groundReflection: boolean = false


physicalReflections​

• physicalReflections: boolean = false


autoFrustumSize​

• autoFrustumSize: boolean = true


autoBakeShadows​

• autoBakeShadows: boolean = true

autoBakeShadows - when true, shadows are baked automatically on scene update(whenever any object in the scene changes), set it to false to trigger baking manually with {@see bakeShadows()}


_dirty​

• Protected _dirty: boolean = false

Inherited from​

BaseGroundPlugin._dirty


_viewer​

• Protected Optional _viewer: ViewerApp

Inherited from​

BaseGroundPlugin._viewer


_geometry​

• Protected _geometry: BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>

Inherited from​

BaseGroundPlugin._geometry


_material​

• Protected Optional _material: MeshStandardMaterial2<IMaterialEventMap>

Inherited from​

BaseGroundPlugin._material


_mesh​

• Protected Optional _mesh: TMesh

Inherited from​

BaseGroundPlugin._mesh


_options​

• Protected _options: GroundOptions

Inherited from​

BaseGroundPlugin._options


_manager​

• Protected Optional _manager: AssetManagerPlugin

Inherited from​

BaseGroundPlugin._manager


_uiConfig​

• Protected Optional _uiConfig: UiObjectConfig<any, string>

Inherited from​

BaseGroundPlugin._uiConfig

Accessors​

dirty​

• get dirty(): boolean

Returns​

boolean

Implementation of​

IViewerPluginAsync.dirty

Inherited from​

BaseGroundPlugin.dirty

• set dirty(value): void

Parameters​

NameType
valueboolean

Returns​

void

Implementation of​

IViewerPluginAsync.dirty

Inherited from​

BaseGroundPlugin.dirty


viewer​

• get viewer(): undefined | ViewerApp

Returns​

undefined | ViewerApp

Inherited from​

BaseGroundPlugin.viewer


enabled​

• get enabled(): boolean

Returns​

boolean

Inherited from​

BaseGroundPlugin.enabled

• set enabled(value): void

Parameters​

NameType
valueboolean

Returns​

void

Inherited from​

BaseGroundPlugin.enabled


material​

• get material(): undefined | MeshStandardMaterial2<IMaterialEventMap>

Returns​

undefined | MeshStandardMaterial2<IMaterialEventMap>

Inherited from​

BaseGroundPlugin.material


mesh​

• get mesh(): undefined | IModel<TMesh, IObject3DEventMap>

Returns​

undefined | IModel<TMesh, IObject3DEventMap>

Inherited from​

BaseGroundPlugin.mesh


autoAdjustTransform​

• get autoAdjustTransform(): boolean

Returns​

boolean

Inherited from​

BaseGroundPlugin.autoAdjustTransform

• set autoAdjustTransform(value): void

Parameters​

NameType
valueboolean

Returns​

void

Inherited from​

BaseGroundPlugin.autoAdjustTransform


uiConfig​

• get uiConfig(): UiObjectConfig<any, string>

Returns​

UiObjectConfig<any, string>

Implementation of​

IViewerPluginAsync.uiConfig

Inherited from​

BaseGroundPlugin.uiConfig


shadowBaker​

• get shadowBaker(): undefined | ShadowMapBaker

Returns​

undefined | ShadowMapBaker

Methods​

toJSON​

▸ toJSON(meta?): any

Parameters​

NameType
meta?any

Returns​

any

Implementation of​

IViewerPluginAsync.toJSON

Inherited from​

BaseGroundPlugin.toJSON


exportState​

▸ exportState(): any

Returns​

any

Inherited from​

BaseGroundPlugin.exportState


importState​

▸ importState(state): Promise<void>

Parameters​

NameType
stateany

Returns​

Promise<void>

Inherited from​

BaseGroundPlugin.importState


storeState​

▸ storeState(prefix?, storage?, data?): void

Parameters​

NameType
prefix?string
storage?Storage
data?any

Returns​

void

Implementation of​

IViewerPluginAsync.storeState

Inherited from​

BaseGroundPlugin.storeState


loadState​

▸ loadState(prefix?, storage?): Promise<void>

Parameters​

NameType
prefix?string
storage?Storage

Returns​

Promise<void>

Implementation of​

IViewerPluginAsync.loadState

Inherited from​

BaseGroundPlugin.loadState


setGeometry​

▸ setGeometry(g?): void

Parameters​

NameType
g?BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>

Returns​

void

Inherited from​

BaseGroundPlugin.setGeometry


refreshTransform​

▸ refreshTransform(): void

Returns​

void

Inherited from​

BaseGroundPlugin.refreshTransform


setOptions​

▸ setOptions(options): void

Parameters​

NameType
optionsPartial<GroundOptions>

Returns​

void

Inherited from​

BaseGroundPlugin.setOptions


bakeShadows​

▸ bakeShadows(): void

bake shadows manually, to be used with {@see autoBakeShadows} set to false

Returns​

void


onAdded​

▸ onAdded(viewer): Promise<void>

Parameters​

NameType
viewerViewerApp

Returns​

Promise<void>

Implementation of​

IViewerPluginAsync.onAdded

Overrides​

BaseGroundPlugin.onAdded


onDispose​

▸ onDispose(viewer): Promise<void>

Parameters​

NameType
viewerViewerApp

Returns​

Promise<void>

Implementation of​

IViewerPluginAsync.onDispose

Overrides​

BaseGroundPlugin.onDispose


onRemove​

▸ onRemove(viewer): Promise<void>

Parameters​

NameType
viewerViewerApp

Returns​

Promise<void>

Implementation of​

IViewerPluginAsync.onRemove

Overrides​

BaseGroundPlugin.onRemove


refreshOptions​

▸ refreshOptions(): void

Returns​

void

Overrides​

BaseGroundPlugin.refreshOptions


fromJSON​

▸ fromJSON(data, meta?): null | GroundPlugin<TMesh>

Parameters​

NameType
dataany
meta?any

Returns​

null | GroundPlugin<TMesh>

Implementation of​

IViewerPluginAsync.fromJSON

Overrides​

BaseGroundPlugin.fromJSON


_storeKey​

▸ Protected _storeKey(prefix?): string

Parameters​

NameType
prefix?string

Returns​

string

Inherited from​

BaseGroundPlugin._storeKey


_createMesh​

▸ Protected _createMesh(): Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap> | Material<MaterialEventMap>[], Object3DEventMap>

Returns​

Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap> | Material<MaterialEventMap>[], Object3DEventMap>

Overrides​

BaseGroundPlugin._createMesh


_postFrame​

▸ Protected _postFrame(): void

Returns​

void

Overrides​

BaseGroundPlugin._postFrame


_preRender​

▸ Protected _preRender(): void

Returns​

void

Overrides​

BaseGroundPlugin._preRender


_removeMaterial​

▸ Protected _removeMaterial(): void

Returns​

void

Overrides​

BaseGroundPlugin._removeMaterial


_onSceneUpdate​

▸ Protected _onSceneUpdate(event): void

Parameters​

NameType
eventIEvent<string>

Returns​

void

Overrides​

BaseGroundPlugin._onSceneUpdate


_refreshTransform​

▸ Protected _refreshTransform(): void

Returns​

void

Overrides​

BaseGroundPlugin._refreshTransform


_refreshMaterial​

▸ Protected _refreshMaterial(): boolean

Returns​

boolean

Overrides​

BaseGroundPlugin._refreshMaterial


_extraUiConfig​

▸ Protected _extraUiConfig(): (UiObjectConfig<any, string> | () => UiObjectConfig<any, string> | UiObjectConfig<any, string>[])[]

Returns​

(UiObjectConfig<any, string> | () => UiObjectConfig<any, string> | UiObjectConfig<any, string>[])[]

Overrides​

BaseGroundPlugin._extraUiConfig

Constructors​

constructor​

• new GroundPlugin<TMesh>(options?, showDebug?)

Type parameters​

NameType
TMeshextends Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, MeshStandardMaterial<MaterialEventMap>, Object3DEventMap> | Reflector2 = Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, MeshStandardMaterial<MaterialEventMap>, Object3DEventMap> | Reflector2

Parameters​

NameTypeDefault value
optionsPartial<GroundOptions>{}
showDebugbooleanfalse

Overrides​

BaseGroundPlugin.constructor