glb-viewer-core/src/roomle-glb-viewer.default
# Implements
# Table of contents
# Constructors
# Properties
# Accessors
# Methods
- clearScene
- getCameraOffset
- getCurrentId
- getScene
- getStorage
- getUnitFormatter
- init
- loadGLB
- loadSceneSetting
- loadStaticItem
- pauseTest
- preparePerspectiveImage
- processRenderList
- resumeTest
- setCameraOffset
- setEnvironmentMap
- setOverrides
- showGUI
- updateScene
- updateSize
# Constructors
# constructor
• new default(creator
)
# Parameters
Name | Type |
---|---|
creator | string |
# Properties
# _creator_
• _creator_: string
# Implementation of
# Accessors
# callbacks
• get
callbacks(): Object
# Returns
Object
# Implementation of
# Methods
# clearScene
▸ clearScene(): void
Remove the current glb from the scene if it exists
# Returns
void
# getCameraOffset
▸ getCameraOffset(): CanvasOffset
Gets the available screen space for our item default: 'left: 0, top: 1, right: 1, bottom: 0'
# Returns
# Implementation of
# getCurrentId
▸ getCurrentId(): string
Returns the current item id or url of the loaded object
# Returns
string
# getScene
▸ getScene(): Scene
Returns the three.js scene (https://threejs.org/docs/#api/en/scenes/Scene) WARNING: This is the actual scene (reference) and not a copy!
# Returns
Scene
# Implementation of
# getStorage
▸ getStorage(): default
returns manager class to interface with indexedDB storage
# Returns
# Implementation of
# getUnitFormatter
▸ getUnitFormatter(): default
returns unit formatter for formatting input und output values in scene
# Returns
# Implementation of
# init
▸ init(element
, initData?
): Promise
<void
>
# Parameters
Name | Type |
---|---|
element | HTMLElement |
initData? | InitDataDefinition |
# Returns
Promise
<void
>
# loadGLB
▸ loadGLB(url
, scaling?
, callback?
): Promise
<void
>
Loads the GLB from the given URL Param
# Parameters
Name | Type | Default value | Description |
---|---|---|---|
url | string | undefined | |
scaling | number | 1 | defaults to 1 |
callback? | (percent : number ) => void | undefined | loading percent between 0 and 1 |
# Returns
Promise
<void
>
# loadSceneSetting
▸ loadSceneSetting(sceneSettings
): Promise
<void
>
Loads a SceneSettings object, currently it can can contain a light setting definition (see @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting) and an environment definition (see @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loaderEnvironmentSetting).
# Parameters
Name | Type |
---|---|
sceneSettings | SceneSettings |
# Returns
Promise
<void
>
# loadStaticItem
▸ loadStaticItem(staticItemId
, callback?
): Promise
<void
>
Loads the glb asset from the static item
# Parameters
Name | Type | Description |
---|---|---|
staticItemId | string | |
callback? | (percent : number ) => void | loading percent between 0 and 1 |
# Returns
Promise
<void
>
# pauseTest
▸ pauseTest(): void
# Returns
void
# preparePerspectiveImage
▸ preparePerspectiveImage(): Promise
<Base64Image
>
# Returns
Promise
<Base64Image
>
# processRenderList
▸ processRenderList(jsonString
, width?
, height?
): void
# Parameters
Name | Type | Default value |
---|---|---|
jsonString | string | undefined |
width | number | 320 |
height | number | 320 |
# Returns
void
# resumeTest
▸ resumeTest(element
): void
# Parameters
Name | Type |
---|---|
element | HTMLElement |
# Returns
void
# setCameraOffset
▸ setCameraOffset(offset
): void
Sets the available screen space for our item Example 1: right 0.9 means 10% padding on the right side Example 2: bottom 0.2 means 20% padding on the bottom side default: 'left: 0, top: 1, right: 1, bottom: 0'
# Parameters
Name | Type |
---|---|
offset | CanvasOffset |
# Returns
void
# Implementation of
# setEnvironmentMap
▸ setEnvironmentMap(params
): void
# Parameters
Name | Type |
---|---|
params | Object |
params.intensity? | number |
params.maxLightSources? | number |
params.rotation? | number |
params.url? | string |
# Returns
void
# Implementation of
# setOverrides
▸ setOverrides(initData
): void
# Parameters
Name | Type |
---|---|
initData | default | Partial <InitDataDefinition & GlobalInitDataDefinition > |
# Returns
void
# showGUI
▸ showGUI(): void
# Returns
void
# updateScene
▸ updateScene(): void
Updates the scene (recalculating bounds) and restart rendering
# Returns
void
# Implementation of
# updateSize
▸ updateSize(): void
# Returns
void