DoppleXR
Defined in: dopple-sdk.d.ts:50
The DoppleXR class represents a DoppleXR experience.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DoppleXR(
config
):DoppleXR
Defined in: dopple-sdk.d.ts:156
Constructs a new instance of DoppleXR.
Parameters
Section titled “Parameters”config
Section titled “config”The configuration object for initializing DoppleXR.
container
Section titled “container”Element
The DOM element to contain the renderers.
cssRenderer?
Section titled “cssRenderer?”any
Optional, a pre-existing CSS renderer to use.
logNamespace
Section titled “logNamespace”string
The namespace for logging.
string
The owner identifier.
productVersion?
Section titled “productVersion?”string
Optional, the product version.
projectName?
Section titled “projectName?”string
Optional, the project name.
renderer?
Section titled “renderer?”any
Optional, a pre-existing WebGL renderer to use.
scene?
Section titled “scene?”any
Optional, a pre-existing scene to use.
selection
Section titled “selection”Selection_2
The current selection state.
sessionId
Section titled “sessionId”string
The session identifier.
workspace
Section titled “workspace”string
The workspace identifier.
Returns
Section titled “Returns”DoppleXR
Properties
Section titled “Properties”camera
Section titled “camera”camera:
any
Defined in: dopple-sdk.d.ts:123
The camera instance for the DoppleXR experience.
composer
Section titled “composer”composer:
EffectComposer
Defined in: dopple-sdk.d.ts:80
container
Section titled “container”container:
Element
Defined in: dopple-sdk.d.ts:87
The DOM element to contain the renderer.
controls
Section titled “controls”controls:
default_2
Defined in: dopple-sdk.d.ts:115
The camera controls for the DoppleXR experience
cssRenderer
Section titled “cssRenderer”cssRenderer:
CSS2DRenderer
Defined in: dopple-sdk.d.ts:111
The CSS renderer for the DoppleXR experience.
environment
Section titled “environment”environment:
Texture
Defined in: dopple-sdk.d.ts:107
The environment texture for the DoppleXR experience.
loadingManager
Section titled “loadingManager”loadingManager:
LoadingManager
Defined in: dopple-sdk.d.ts:132
The loading manager for the DoppleXR experience.
logger
Section titled “logger”logger:
Logger
Defined in: dopple-sdk.d.ts:71
The logger instance for the DoppleXR experience.
logNamespace
Section titled “logNamespace”logNamespace:
string
Defined in: dopple-sdk.d.ts:75
The log namespace for the DoppleXR experience.
matrix
Section titled “matrix”matrix:
Matrix
Defined in: dopple-sdk.d.ts:91
The matrix for the DoppleXR experience.
models
Section titled “models”models:
Record
<string
,GLTF
>
Defined in: dopple-sdk.d.ts:119
A record of GLTF models for the DoppleXR experience.
owner:
string
Defined in: dopple-sdk.d.ts:55
The owner of the DoppleXR experience.
productVersion
Section titled “productVersion”productVersion:
string
Defined in: dopple-sdk.d.ts:67
The product version of the DoppleXR experience.
projectName
Section titled “projectName”projectName:
string
Defined in: dopple-sdk.d.ts:63
The project name of the DoppleXR experience.
raycaster
Section titled “raycaster”raycaster:
Raycaster
Defined in: dopple-sdk.d.ts:127
The raycaster for the DoppleXR experience.
renderer
Section titled “renderer”renderer:
WebGLRenderer
Defined in: dopple-sdk.d.ts:103
The WebGL renderer for the DoppleXR experience.
renderPass
Section titled “renderPass”renderPass:
RenderPass
Defined in: dopple-sdk.d.ts:81
renderTarget
Section titled “renderTarget”renderTarget:
any
Defined in: dopple-sdk.d.ts:83
resetLabels()
Section titled “resetLabels()”resetLabels: () =>
void
Defined in: dopple-sdk.d.ts:128
Returns
Section titled “Returns”void
run: () =>
void
Defined in: dopple-sdk.d.ts:281
Render the scene and then schedule the next frame.
Returns
Section titled “Returns”void
scene:
Scene
Defined in: dopple-sdk.d.ts:95
The scene instance for the DoppleXR experience.
scenes
Section titled “scenes”scenes:
Record
<string
,Scene
>
Defined in: dopple-sdk.d.ts:99
scenes - A record of scenes for the DoppleXR experience.
selection
Section titled “selection”selection:
Selection_2
Defined in: dopple-sdk.d.ts:136
The current selection state.
sessionId
Section titled “sessionId”sessionId:
string
Defined in: dopple-sdk.d.ts:79
The session identifier for the DoppleXR experience.
taaRenderPass
Section titled “taaRenderPass”taaRenderPass:
TAARenderPass
Defined in: dopple-sdk.d.ts:82
updateMatrix()
Section titled “updateMatrix()”updateMatrix: (
newSelection?
,matrix?
,__namedParameters?
) =>Promise
<Result
<void
,Error
>>
Defined in: dopple-sdk.d.ts:251
Update the selection of products, cameras, nodes, variants, hotspots and environments
Parameters
Section titled “Parameters”newSelection?
Section titled “newSelection?”Selection_2
matrix?
Section titled “matrix?”Matrix
__namedParameters?
Section titled “__namedParameters?”disableHotspots?
Section titled “disableHotspots?”boolean
Returns
Section titled “Returns”Promise
<Result
<void
, Error
>>
workspace
Section titled “workspace”workspace:
string
Defined in: dopple-sdk.d.ts:59
The workspace of the DoppleXR experience.
Methods
Section titled “Methods”[dispose]()
Section titled “[dispose]()”[dispose]():
void
Defined in: dopple-sdk.d.ts:303
Dispose of the scene and its associated resources.
Returns
Section titled “Returns”void
addLogWriter()
Section titled “addLogWriter()”addLogWriter(
writer
):void
Defined in: dopple-sdk.d.ts:174
Adds a log writer to the set of log writers.
Parameters
Section titled “Parameters”writer
Section titled “writer”LogWriter
The log writer to be added.
Returns
Section titled “Returns”void
animate()
Section titled “animate()”animate():
void
Defined in: dopple-sdk.d.ts:287
Render the scene and then schedule the next frame.
This function is a no-op if the scene is paused.
Returns
Section titled “Returns”void
disableHotspots()
Section titled “disableHotspots()”disableHotspots():
void
Defined in: dopple-sdk.d.ts:311
Removes the hotspot group from the scene, making them invisible and non-interactable.
Returns
Section titled “Returns”void
enableHotspots()
Section titled “enableHotspots()”enableHotspots():
void
Defined in: dopple-sdk.d.ts:307
Adds the hotspot group to the scene, making them visible and interactable.
Returns
Section titled “Returns”void
generateShareURL()
Section titled “generateShareURL()”generateShareURL(
options?
):Promise
<{qrCode
:null
|string
;url
:string
; }>
Defined in: dopple-sdk.d.ts:216
Generates a shareable URL for the AR experience.
This method constructs a URL containing necessary parameters for the AR session and optionally generates a QR code for easy sharing.
Parameters
Section titled “Parameters”options?
Section titled “options?”Configuration options for the URL generation.
arMode?
Section titled “arMode?”boolean
Whether AR mode should be enabled in the link.
baseUrl?
Section titled “baseUrl?”string
The base URL to use for the shareable link.
qrCode?
Section titled “qrCode?”boolean
Whether to generate a QR code for the link.
Returns
Section titled “Returns”Promise
<{ qrCode
: null
| string
; url
: string
; }>
An object containing the shareable URL and an optional QR code data URL.
getTarget()
Section titled “getTarget()”getTarget():
Vector3
Defined in: dopple-sdk.d.ts:332
Retrieves the target position for the object.
This method returns a clone of the goalTarget vector, multiplied by -1, effectively inverting its direction.
Returns
Section titled “Returns”Vector3
A Vector3 representing the target position.
load()
Section titled “load()”load():
Promise
<Result
<void
,Error
>>
Defined in: dopple-sdk.d.ts:189
Loads the product.
This method is called when the DoppleXR instance is created. It loads the product’s matrix and sets up the camera, controls and renderer.
Returns
Section titled “Returns”Promise
<Result
<void
, Error
>>
A promise that is resolved when the product is loaded.
removeLogWriter()
Section titled “removeLogWriter()”removeLogWriter():
void
Defined in: dopple-sdk.d.ts:180
Removes all log writers from the set of log writers.
Use this when you want to stop sending logs to all log writers.
Returns
Section titled “Returns”void
render()
Section titled “render()”render():
void
Defined in: dopple-sdk.d.ts:277
Renders the scene using both WebGL and CSS renderers. Updates control states and applies auto-rotation if enabled. The rendering process involves clearing the canvas, rendering the 3D scene with the main renderer, and then rendering CSS-based elements with the CSS renderer. Also updates animation mixer with the delta time.
Returns
Section titled “Returns”void
resize()
Section titled “resize()”resize(
options?
):void
Defined in: dopple-sdk.d.ts:297
Resize the canvas to the size of the container and update the camera’s
aspect ratio. If trackParentSize
is true
, the canvas will be resized
automatically whenever the parent container is resized.
Parameters
Section titled “Parameters”options?
Section titled “options?”trackParentSize?
Section titled “trackParentSize?”boolean
Returns
Section titled “Returns”void
setTarget()
Section titled “setTarget()”setTarget(
modelX
,modelY
,modelZ
):void
Defined in: dopple-sdk.d.ts:323
Sets the target position for the goalTarget vector.
This method updates the goalTarget vector to the negated values of the provided model coordinates.
Parameters
Section titled “Parameters”modelX
Section titled “modelX”number
The X coordinate of the model.
modelY
Section titled “modelY”number
The Y coordinate of the model.
modelZ
Section titled “modelZ”number
The Z coordinate of the model.
Returns
Section titled “Returns”void
startAR()
Section titled “startAR()”startAR():
Promise
<string
>
Defined in: dopple-sdk.d.ts:203
Starts the AR experience.
If the device is a mobile device with WebXR support, this method will start the AR experience using the WebXR API. Otherwise, it will generate a QR code that can be scanned to open the AR experience on a mobile device.
If the device is an Android device without WebXR support, this method will return an empty string.
Returns
Section titled “Returns”Promise
<string
>
A string containing the QR code data URL, or an empty string if the device is an Android device without WebXR support.
stopAR()
Section titled “stopAR()”stopAR():
Promise
<void
>
Defined in: dopple-sdk.d.ts:247
Stops the AR experience.
This method will stop the AR experience if it is currently running.
Returns
Section titled “Returns”Promise
<void
>
A Promise that resolves when the AR experience has been stopped.
takeSnapshot()
Section titled “takeSnapshot()”takeSnapshot(
options?
):Promise
<void
>
Defined in: dopple-sdk.d.ts:239
Takes a snapshot of the current scene.
Parameters
Section titled “Parameters”options?
Section titled “options?”Optional options.
Returns
Section titled “Returns”Promise
<void
>
A Promise that resolves when the snapshot has been taken.
updateSelection()
Section titled “updateSelection()”updateSelection(
newSelection?
,matrix?
,options?
):Promise
<Result
<void
,Error
>>
Defined in: dopple-sdk.d.ts:267
Update the selection of products, cameras, nodes, variants, hotspots and environments based on the given selection and matrix.
Parameters
Section titled “Parameters”newSelection?
Section titled “newSelection?”Selection_2
an object with choice IDs as keys and option IDs as values.
matrix?
Section titled “matrix?”Matrix
the matrix to use for selection. If not provided, the current matrix will be used.
options?
Section titled “options?”options object with the following properties:
disableHotspots
: if true, hotspots will not be updated.
disableHotspots?
Section titled “disableHotspots?”boolean
Returns
Section titled “Returns”Promise
<Result
<void
, Error
>>
updateTarget()
Section titled “updateTarget()”updateTarget(
delta
):boolean
Defined in: dopple-sdk.d.ts:340
Smoothly updates the product group’s position to the target position over time.
Parameters
Section titled “Parameters”number
The time in milliseconds since the last frame.
Returns
Section titled “Returns”boolean
A boolean indicating whether the product group was moved.