Module: Core-API
Classes
- WebGiViewerElement
- AViewerPlugin
- BaseRenderer
- CameraController
- EffectComposer2
- DirectionalLight2
- SpotLight2
- PointLight2
- AmbientLight2
- Object3DModel
- OrbitControls3
- RootScene
- AAssetManagerProcessStatePlugin
- AMaterialManager
- AssetManagerLoadingBarPlugin
- AssetManagerPlugin
- AssetManagerBasicPopupPlugin
- LoadingScreenPlugin
- SimpleDataSource
- SimpleAssetList
- AssetImporter
- Importer
- MaterialExtender
- MaterialManager
- MeshBasicMaterial2
- MeshStandardMaterial2
- ViewerApp
Interfaces
- ICameraControls
- CameraControllerEventMap
- AddObjectOptions
- IMaterialManager
- IMaterialTemplate
- ILoader
- IExportParser
- IImporter
- IExporter
- IAssetSearchQuery
- IAsset
- IAssetList
- IDataSource
- IAssetExporter
- IAssetManager
- ImportFileOptions
- IAssetImporter
- AssetManagerOptions
- MaterialExtension
- AddModelOptions
- IWidget
- IScene
- IRenderOptions
- IShaderPropertiesUpdater
- CreateRenderTargetOptions
- IEffectComposer
- IRenderer
- ICameraOptions
- IPerspectiveCameraOptions
- IOrthographicCameraOptions
- ICamera
- IModel
- ILight
- IMaterial
- IPass
- IFilter
- ITexture
- IRenderTarget
- IViewerPlugin
- IViewerPluginSync
- IViewerPluginAsync
- UiObjectConfig
- IUiConfigContainer
- IGBufferUpdater
- BufferGeometryEventMap
- MaterialEventMap
- Object3DEventMap
- IMaterialEventMap
- IObject3DEventMap
- ISceneEventMap
- Object3D
- IViewerAppOptions
Enumerations
Type aliases
HTMLElementEventMap2
Ƭ HTMLElementEventMap2: HTMLElementEventMap & { initialized: Event }
TOrbitControlsEvents
Ƭ TOrbitControlsEvents: "change" | "end" | "start"
TControlsCtor
Ƭ TControlsCtor: (camera: Camera, domElement: HTMLElement | Document) => TCameraControls
Type declaration
▸ (camera, domElement): TCameraControls
Parameters
| Name | Type |
|---|---|
camera | Camera |
domElement | HTMLElement | Document |
Returns
TCameraControls
Ƭ TCameraControls: ICameraControls
Object3DModelOptions
Ƭ Object3DModelOptions: AddModelOptions & { pseudoCenter?: boolean ; autoCenter?: boolean ; license?: string }
IMaterialGenerator
Ƭ IMaterialGenerator: (params: any, oldMaterial: any) => IMaterial
Type declaration
▸ (params, oldMaterial): IMaterial
Parameters
| Name | Type |
|---|---|
params | any |
oldMaterial | any |
Returns
IAssetID
Ƭ IAssetID: string
ExportFileOptions
Ƭ ExportFileOptions: { exportExt?: string ; viewerConfig?: boolean } & GLTFExporter2Options & AnyOptions
ProcessImportedOptions
Ƭ ProcessImportedOptions: { processImported?: boolean ; forceImporterReprocess?: boolean ; rootPath?: string ; generateMipmaps?: boolean ; _testDataTextureComplete?: boolean } & Object3DModelOptions & AnyOptions
ImportFilesOptions
Ƭ ImportFilesOptions: ProcessImportedOptions & ImportFileOptions & { allowedExtensions?: string[] }
ImportAssetOptions
Ƭ ImportAssetOptions: { forceImport?: boolean ; reimportDisposed?: boolean ; pathOverride?: string ; importedFile?: IFile } & ProcessImportedOptions & ImportFileOptions & AnyOptions
ImportAddOptions
Ƭ ImportAddOptions: ImportAssetOptions & AddModelOptions & AddObjectOptions
AddImportedOptions
Ƭ AddImportedOptions: ProcessImportedOptions & AddObjectOptions & AddModelOptions
AssetImportEventTypes
Ƭ AssetImportEventTypes: "onLoad" | "onProgress" | "onStop" | "onError" | "onStart" | "loaderCreate" | "importFile" | "importFiles" | "processFileStart" | "processFileEnd"
TAssetTypes
Ƭ TAssetTypes: "model" | "texture" | "light" | "material" | "widget"
IFile
Ƭ IFile: Partial<File> & { name: string ; type: string ; objectUrl?: string ; importId?: string ; ext?: string }
ISceneObject
Ƭ ISceneObject<T>: IModel<T> | ILight<T> | ITexture<T> | IMaterial<T> & IUiConfigContainer
Type parameters
| Name | Type |
|---|---|
T | any |
TCameraControlsMode
Ƭ TCameraControlsMode: "" | "orbit" | "deviceOrientation" | "firstPerson" | "pointerLock" | string
IGeometry
Ƭ IGeometry: any
Others
IShader
Ƭ IShader: IEventDispatcher<string>
IPassID
Ƭ IPassID: string
TUiRefreshModes
Ƭ TUiRefreshModes: "preRender" | "postRender" | "preFrame" | "postFrame"
UI
UiObjectType
Ƭ UiObjectType: string
TViewerScreenShaderFrag
Ƭ TViewerScreenShaderFrag: string | [string, string] | { pars?: string ; main: string }
TViewerScreenShader
Ƭ TViewerScreenShader: TViewerScreenShaderFrag | ShaderPass2
EnvMapBackground
Ƭ EnvMapBackground: "envMapBackground"
Type for {@see envMapBackground}
deprecated will be removed
Functions
makeFilter
▸ makeFilter<Tid, TPass>(viewer, filter, updaters?): IFilter<TPass, Tid>
Type parameters
| Name | Type |
|---|---|
Tid | extends string |
TPass | extends IPass<TPass> |
Parameters
| Name | Type |
|---|---|
viewer | ViewerApp |
filter | PartialPick<IFilter<TPass, Tid>, "passId" | "passObject"> |
updaters? | (undefined | IShaderPropertiesUpdater)[] | () => (undefined | IShaderPropertiesUpdater)[] |
Returns
IFilter<TPass, Tid>
createRenderTargetKey
▸ createRenderTargetKey(op?): string
Parameters
| Name | Type |
|---|---|
op | CreateRenderTargetOptions |
Returns
string
setupObject3dModel
▸ setupObject3dModel(obj, modelProcessor): IModel<Object3D<Object3DEventMap>, IObject3DEventMap>
Setup an Object3DModel with a model processor
Parameters
| Name | Type |
|---|---|
obj | IModel<Object3D<Object3DEventMap>, IObject3DEventMap> |
modelProcessor | (m: IModel<any, IObject3DEventMap>) => undefined | IModel<any, IObject3DEventMap> |
Returns
IModel<Object3D<Object3DEventMap>, IObject3DEventMap>
setupIModel
▸ setupIModel(object, parent?, modelProcessor?): IModel & Object3D
Converts three.js Object3D to IModel, setup object events, adds utility methods, and runs model processor.
Parameters
| Name | Type |
|---|---|
object | Object3D<Object3DEventMap> & IModel<any, IObject3DEventMap> |
parent? | IModel<any, IObject3DEventMap> |
modelProcessor? | (m: IModel<any, IObject3DEventMap>) => undefined | IModel<any, IObject3DEventMap> |
Returns
IModel & Object3D
setMeshMaterial
▸ setMeshMaterial(mesh, material): IMaterial[]
Parameters
| Name | Type |
|---|---|
mesh | IModel<any, IObject3DEventMap> |
material | undefined | null | IMaterial<any, IMaterialEventMap> | IMaterial<any, IMaterialEventMap>[] |
Returns
setMeshGeometry
▸ setMeshGeometry(mesh, geometry, force?): BufferGeometry | undefined
Parameters
| Name | Type | Default value |
|---|---|---|
mesh | IModel<any, IObject3DEventMap> | undefined |
geometry | undefined | null | BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap> | undefined |
force | boolean | false |
Returns
BufferGeometry | undefined
copyObject3DUserData
▸ copyObject3DUserData(dest, source): any
Parameters
| Name | Type |
|---|---|
dest | any |
source | any |
Returns
any
getTextureDataType
▸ getTextureDataType(renderer?): TextureDataType
Parameters
| Name | Type |
|---|---|
renderer? | WebGLRenderer |
Returns
TextureDataType
makeSamplerUi
▸ makeSamplerUi<T>(mat, map, label?, hidden?, setDirty?): UiObjectConfig<any, string>
Type parameters
| Name | Type |
|---|---|
T | extends IMaterial<any, IMaterialEventMap, T> |
Parameters
| Name | Type |
|---|---|
mat | T |
map | keyof T |
label? | string |
hidden? | () => boolean |
setDirty? | () => any |
Returns
UiObjectConfig<any, string>
copyMaterialUserData
▸ copyMaterialUserData(dest, source, isRoot?): any
Parameters
| Name | Type | Default value |
|---|---|---|
dest | any | undefined |
source | any | undefined |
isRoot | boolean | true |
Returns
any
copyTextureUserData
▸ copyTextureUserData(dest, source): any
Parameters
| Name | Type |
|---|---|
dest | any |
source | any |
Returns
any
uiConfig
▸ uiConfig(uiType?, params?): PropertyDecorator
Parameters
| Name | Type |
|---|---|
uiType? | string |
params? | AnyOptions |
Returns
PropertyDecorator
uiToggle
▸ uiToggle(label?, params?): PropertyDecorator
Parameters
| Name | Type |
|---|---|
label? | string |
params? | any |
Returns
PropertyDecorator
uiMonitor
▸ uiMonitor(label?, params?): PropertyDecorator
Parameters
| Name | Type |
|---|---|
label? | string |
params? | any |
Returns
PropertyDecorator
uiSlider
▸ uiSlider(label?, bounds?, stepSize?, params?): PropertyDecorator
Parameters
| Name | Type |
|---|---|
label? | string |
bounds? | [number, number] |
stepSize? | number |
params? | any |
Returns
PropertyDecorator
uiVector
▸ uiVector(label?, bounds?, stepSize?, params?): PropertyDecorator
Parameters
| Name | Type |
|---|---|
label? | string |
bounds? | [number, number] |
stepSize? | number |
params? | any |
Returns
PropertyDecorator
uiDropdown
▸ uiDropdown(label?, children?, params?): PropertyDecorator
Parameters
| Name | Type |
|---|---|
label? | string |
children? | ValOrFunc<UiObjectConfig<any, string>[], any[]> |
params? | any |
Returns
PropertyDecorator
uiButton
▸ uiButton(label?, params?): PropertyDecorator
Parameters
| Name | Type |
|---|---|
label? | string |
params? | any |
Returns
PropertyDecorator
uiInput
▸ uiInput(label?, params?): PropertyDecorator
Parameters
| Name | Type |
|---|---|
label? | string |
params? | any |
Returns
PropertyDecorator
uiColor
▸ uiColor(label?, params?): PropertyDecorator
Parameters
| Name | Type |
|---|---|
label? | string |
params? | any |
Returns
PropertyDecorator
uiImage
▸ uiImage(label?, params?): PropertyDecorator
Parameters
| Name | Type |
|---|---|
label? | string |
params? | any |
Returns
PropertyDecorator
generateUiConfig
▸ generateUiConfig(obj): UiObjectConfig[]
Parameters
| Name | Type |
|---|---|
obj | any |
Returns
generateUiFolder
▸ generateUiFolder(label, obj, params?, type?, dynamic?): UiObjectConfig
Parameters
| Name | Type | Default value |
|---|---|---|
label | string | undefined |
obj | any | undefined |
params | any | {} |
type | string | 'folder' |
dynamic | boolean | false |
Returns
uiFolder
▸ uiFolder(label, params?, type?): <T>(constructor: T) => { prototype: __class<any> } & T
Parameters
| Name | Type | Default value |
|---|---|---|
label | string | undefined |
params? | any | undefined |
type | string | 'folder' |
Returns
fn
▸ <T>(constructor): { prototype: __class<any> } & T
Type parameters
| Name | Type |
|---|---|
T | extends (...args: any[]) => any |
Parameters
| Name | Type |
|---|---|
constructor | T |
Returns
{ prototype: __class<any> } & T
uiPanel
▸ uiPanel(label, params?): <T>(constructor: T) => { prototype: __class<any> } & T
Parameters
| Name | Type |
|---|---|
label | string |
params? | any |
Returns
fn
▸ <T>(constructor): { prototype: __class<any> } & T
Type parameters
| Name | Type |
|---|---|
T | extends (...args: any[]) => any |
Parameters
| Name | Type |
|---|---|
constructor | T |
Returns
{ prototype: __class<any> } & T
valueToUiType
▸ valueToUiType(val): null | "input" | "button" | "folder" | "checkbox" | "number" | "vec" | "color" | "image"
Parameters
| Name | Type |
|---|---|
val | any |
Returns
null | "input" | "button" | "folder" | "checkbox" | "number" | "vec" | "color" | "image"
Variables
iGeometryIgnoredUserData
• Const iGeometryIgnoredUserData: string[]
iModelIgnoredUserData
• Const iModelIgnoredUserData: string[]
basicMaterialPropList
• Const basicMaterialPropList: Object
Type declaration
| Name | Type |
|---|---|
name | string |
blending | 1 |
side | 0 |
vertexColors | boolean |
opacity | number |
transparent | boolean |
blendSrc | 204 |
blendDst | 205 |
blendEquation | 100 |
blendSrcAlpha | null |
blendDstAlpha | null |
blendEquationAlpha | null |
depthFunc | 3 |
depthTest | boolean |
depthWrite | boolean |
stencilWriteMask | number |
stencilFunc | 519 |
stencilRef | number |
stencilFuncMask | number |
stencilFail | 7680 |
stencilZFail | 7680 |
stencilZPass | 7680 |
stencilWrite | boolean |
clippingPlanes | null |
clipIntersection | boolean |
clipShadows | boolean |
shadowSide | null |
colorWrite | boolean |
precision | null |
polygonOffset | boolean |
polygonOffsetFactor | number |
polygonOffsetUnits | number |
dithering | boolean |
alphaToCoverage | boolean |
premultipliedAlpha | boolean |
forceSinglePass | boolean |
visible | boolean |
toneMapped | boolean |
userData | {} |
alphaTest | number |
alphaHash | boolean |
color | string |
map | null |
lightMap | null |
lightMapIntensity | number |
aoMap | null |
aoMapIntensity | number |
specularMap | null |
alphaMap | null |
envMap | null |
combine | 0 |
reflectivity | number |
refractionRatio | number |
wireframe | boolean |
wireframeLinewidth | number |
wireframeLinecap | string |
wireframeLinejoin | string |
skinning | boolean |
fog | boolean |
standardMaterialPropList
• Const standardMaterialPropList: Object
Type declaration
| Name | Type |
|---|---|
name | string |
blending | 1 |
side | 0 |
vertexColors | boolean |
opacity | number |
transparent | boolean |
blendSrc | 204 |
blendDst | 205 |
blendEquation | 100 |
blendSrcAlpha | null |
blendDstAlpha | null |
blendEquationAlpha | null |
depthFunc | 3 |
depthTest | boolean |
depthWrite | boolean |
stencilWriteMask | number |
stencilFunc | 519 |
stencilRef | number |
stencilFuncMask | number |
stencilFail | 7680 |
stencilZFail | 7680 |
stencilZPass | 7680 |
stencilWrite | boolean |
clippingPlanes | null |
clipIntersection | boolean |
clipShadows | boolean |
shadowSide | null |
colorWrite | boolean |
precision | null |
polygonOffset | boolean |
polygonOffsetFactor | number |
polygonOffsetUnits | number |
dithering | boolean |
alphaToCoverage | boolean |
premultipliedAlpha | boolean |
forceSinglePass | boolean |
visible | boolean |
toneMapped | boolean |
userData | {} |
alphaTest | number |
alphaHash | boolean |
color | string |
roughness | number |
metalness | number |
map | null |
lightMap | null |
lightMapIntensity | number |
aoMap | null |
aoMapIntensity | number |
emissive | string |
emissiveIntensity | number |
emissiveMap | null |
bumpMap | null |
bumpScale | number |
normalMap | null |
normalMapType | 0 |
normalScale | Vector2 |
displacementMap | null |
displacementScale | number |
displacementBias | number |
roughnessMap | null |
metalnessMap | null |
alphaMap | null |
envMap | null |
envMapIntensity | number |
wireframe | boolean |
wireframeLinewidth | number |
wireframeLinecap | string |
wireframeLinejoin | string |
flatShading | boolean |
fog | boolean |
physicalMaterialPropList
• Const physicalMaterialPropList: Object
Type declaration
| Name | Type |
|---|---|
name | string |
blending | 1 |
side | 0 |
vertexColors | boolean |
opacity | number |
transparent | boolean |
blendSrc | 204 |
blendDst | 205 |
blendEquation | 100 |
blendSrcAlpha | null |
blendDstAlpha | null |
blendEquationAlpha | null |
depthFunc | 3 |
depthTest | boolean |
depthWrite | boolean |
stencilWriteMask | number |
stencilFunc | 519 |
stencilRef | number |
stencilFuncMask | number |
stencilFail | 7680 |
stencilZFail | 7680 |
stencilZPass | 7680 |
stencilWrite | boolean |
clippingPlanes | null |
clipIntersection | boolean |
clipShadows | boolean |
shadowSide | null |
colorWrite | boolean |
precision | null |
polygonOffset | boolean |
polygonOffsetFactor | number |
polygonOffsetUnits | number |
dithering | boolean |
alphaToCoverage | boolean |
premultipliedAlpha | boolean |
forceSinglePass | boolean |
visible | boolean |
toneMapped | boolean |
userData | {} |
alphaTest | number |
alphaHash | boolean |
color | string |
roughness | number |
metalness | number |
map | null |
lightMap | null |
lightMapIntensity | number |
aoMap | null |
aoMapIntensity | number |
emissive | string |
emissiveIntensity | number |
emissiveMap | null |
bumpMap | null |
bumpScale | number |
normalMap | null |
normalMapType | 0 |
normalScale | Vector2 |
displacementMap | null |
displacementScale | number |
displacementBias | number |
roughnessMap | null |
metalnessMap | null |
alphaMap | null |
envMap | null |
envMapIntensity | number |
wireframe | boolean |
wireframeLinewidth | number |
wireframeLinecap | string |
wireframeLinejoin | string |
flatShading | boolean |
fog | boolean |
clearcoat | number |
clearcoatMap | null |
clearcoatRoughness | number |
clearcoatRoughnessMap | null |
clearcoatNormalScale | Vector2 |
clearcoatNormalMap | null |
reflectivity | number |
iridescence | number |
iridescenceMap | null |
iridescenceIOR | number |
iridescenceThicknessRange | number[] |
iridescenceThicknessMap | null |
sheen | number |
sheenColor | Color |
sheenColorMap | null |
sheenRoughness | number |
sheenRoughnessMap | null |
transmission | number |
transmissionMap | null |
thickness | number |
thicknessMap | null |
attenuationDistance | number |
attenuationColor | Color |
specularIntensity | number |
specularIntensityMap | null |
specularColor | Color |
specularColorMap | null |
iMaterialIgnoredUserData
• Const iMaterialIgnoredUserData: string[]
iTextureIgnoredUserData
• Const iTextureIgnoredUserData: string[]
envMapBackground
• Const envMapBackground: EnvMapBackground = 'envMapBackground'
Special value for background to use the environment map.
deprecated will be removed, use 'environment' instead by passing into {@see RootScene.setBackground}