Skip to content

DoppleXR

Defined in: dopple-sdk.d.ts:50

The DoppleXR class represents a DoppleXR experience.

new DoppleXR(config): DoppleXR

Defined in: dopple-sdk.d.ts:156

Constructs a new instance of DoppleXR.

The configuration object for initializing DoppleXR.

Element

The DOM element to contain the renderers.

any

Optional, a pre-existing CSS renderer to use.

string

The namespace for logging.

string

The owner identifier.

string

Optional, the product version.

string

Optional, the project name.

any

Optional, a pre-existing WebGL renderer to use.

any

Optional, a pre-existing scene to use.

Selection_2

The current selection state.

string

The session identifier.

string

The workspace identifier.

DoppleXR

camera: any

Defined in: dopple-sdk.d.ts:123

The camera instance for the DoppleXR experience.


composer: EffectComposer

Defined in: dopple-sdk.d.ts:80


container: Element

Defined in: dopple-sdk.d.ts:87

The DOM element to contain the renderer.


controls: default_2

Defined in: dopple-sdk.d.ts:115

The camera controls for the DoppleXR experience


cssRenderer: CSS2DRenderer

Defined in: dopple-sdk.d.ts:111

The CSS renderer for the DoppleXR experience.


environment: Texture

Defined in: dopple-sdk.d.ts:107

The environment texture for the DoppleXR experience.


loadingManager: LoadingManager

Defined in: dopple-sdk.d.ts:132

The loading manager for the DoppleXR experience.


logger: Logger

Defined in: dopple-sdk.d.ts:71

The logger instance for the DoppleXR experience.


logNamespace: string

Defined in: dopple-sdk.d.ts:75

The log namespace for the DoppleXR experience.


matrix: Matrix

Defined in: dopple-sdk.d.ts:91

The matrix for the DoppleXR experience.


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: string

Defined in: dopple-sdk.d.ts:67

The product version of the DoppleXR experience.


projectName: string

Defined in: dopple-sdk.d.ts:63

The project name of the DoppleXR experience.


raycaster: Raycaster

Defined in: dopple-sdk.d.ts:127

The raycaster for the DoppleXR experience.


renderer: WebGLRenderer

Defined in: dopple-sdk.d.ts:103

The WebGL renderer for the DoppleXR experience.


renderPass: RenderPass

Defined in: dopple-sdk.d.ts:81


renderTarget: any

Defined in: dopple-sdk.d.ts:83


resetLabels: () => void

Defined in: dopple-sdk.d.ts:128

void


run: () => void

Defined in: dopple-sdk.d.ts:281

Render the scene and then schedule the next frame.

void


scene: Scene

Defined in: dopple-sdk.d.ts:95

The scene instance for the DoppleXR experience.


scenes: Record<string, Scene>

Defined in: dopple-sdk.d.ts:99

scenes - A record of scenes for the DoppleXR experience.


selection: Selection_2

Defined in: dopple-sdk.d.ts:136

The current selection state.


sessionId: string

Defined in: dopple-sdk.d.ts:79

The session identifier for the DoppleXR experience.


taaRenderPass: TAARenderPass

Defined in: dopple-sdk.d.ts:82


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

Selection_2

Matrix

boolean

Promise<Result<void, Error>>


workspace: string

Defined in: dopple-sdk.d.ts:59

The workspace of the DoppleXR experience.

[dispose](): void

Defined in: dopple-sdk.d.ts:303

Dispose of the scene and its associated resources.

void


addLogWriter(writer): void

Defined in: dopple-sdk.d.ts:174

Adds a log writer to the set of log writers.

LogWriter

The log writer to be added.

void


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.

void


disableHotspots(): void

Defined in: dopple-sdk.d.ts:311

Removes the hotspot group from the scene, making them invisible and non-interactable.

void


enableHotspots(): void

Defined in: dopple-sdk.d.ts:307

Adds the hotspot group to the scene, making them visible and interactable.

void


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.

Configuration options for the URL generation.

boolean

Whether AR mode should be enabled in the link.

string

The base URL to use for the shareable link.

boolean

Whether to generate a QR code for the link.

Promise<{ qrCode: null | string; url: string; }>

An object containing the shareable URL and an optional QR code data URL.


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.

Vector3

A Vector3 representing the target position.


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.

Promise<Result<void, Error>>

A promise that is resolved when the product is loaded.


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.

void


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.

void


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.

boolean

void


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.

number

The X coordinate of the model.

number

The Y coordinate of the model.

number

The Z coordinate of the model.

void


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.

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(): 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.

Promise<void>

A Promise that resolves when the AR experience has been stopped.


takeSnapshot(options?): Promise<void>

Defined in: dopple-sdk.d.ts:239

Takes a snapshot of the current scene.

SnapshotOptions

Optional options.

Promise<void>

A Promise that resolves when the snapshot has been taken.


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.

Selection_2

an object with choice IDs as keys and option IDs as values.

Matrix

the matrix to use for selection. If not provided, the current matrix will be used.

options object with the following properties:

  • disableHotspots: if true, hotspots will not be updated.

boolean

Promise<Result<void, Error>>


updateTarget(delta): boolean

Defined in: dopple-sdk.d.ts:340

Smoothly updates the product group’s position to the target position over time.

number

The time in milliseconds since the last frame.

boolean

A boolean indicating whether the product group was moved.