Skip to content

TELEPORT.Manager

Central orchestrator managing the loading lifecycle, spatial requests, and raycast bindings. Extends EventTarget.

Constructor#

new Manager({ renderer, scene, camera, sparkConfig, baseApiUrl })

Parameters:

  • Object with:
    • renderer (THREE.WebGLRenderer): The primary Three.js WebGL application renderer.
    • scene (THREE.Scene): The live scene instance where splat meshes are appended.
    • camera (THREE.Camera): The perspective camera driving foveation targets.
    • sparkConfig (Object, optional): Custom SparkRenderer configurations.
    • baseApiUrl (string, optional): Root endpoint server address. Defaults to "https://teleport.varjo.com".

Attributes#

captures#

Returns a Map<TELEPORT.Capture> (see TELEPORT.Capture) that contains the currently loaded captures, fetched by their resourceID: if the capture was loaded with the sid and a segmentEid, the Map key will equal to <sid>-<segmentEid> (note the -), otherwise, it will be just the sid.


Methods#

loadCapture(sid, options)#

Main public entry point. Asynchronously fetches metadata, builds structural wrappers, and loads the Capture SplatMesh into the scene.

Parameters:

  • sid (string): The capture's Share ID.
  • options (Object, optional): Configuration overrides for runtime settings.
    • segmentEid (string): If the capture has more than one segment trained, you can pass its ID to load it specifically.
    • cropVariant (string): The identifier (if available) of the cropped version of the capture (e.g. autocrop).
    • position (Array<number>|THREE.Vector3): Shift the baseline offset position of this splat in the scene.
    • rotation (Array<number>|THREE.Quaternion): Change the baseline orientation of this splat in the scene.
    • scale (Array<number>|THREE.Vector3): Scale this splat in the scene.

Returns: Promise<TELEPORT.Capture> (see TELEPORT.Capture)


raycast(clientX, clientY, customCamera)#

Performs a pointer-ray intersection query targeting spatial volumes across all mounted splats.

Parameters:

  • clientX (number): The browser mouse event X coordinate.
  • clientY (number): The browser mouse event Y coordinate.
  • customCamera (THREE.Camera, optional): Camera framework override.

Returns: Object | null — Hit metadata (capture, point, distance, faceIndex, object) or null.


update(threeCamera)#

Explicit manually triggered frame calculations tick. Only required if SparkRenderer autoUpdate is set to false.

Parameters:

  • threeCamera (THREE.Camera, optional): Target camera matrix source.