Skip to main content

XR8.XrController.configure()

XrController.configure({ disableWorldTracking, enableLighting, enableWorldPoints, imageTargets: [], leftHandedAxes, mirroredDisplay, scale })

Description

Configures the processing performed by XrController (some settings may have performance implications).

Parameters

ParameterTypeDefaultDescription
disableWorldTracking [Optional]BooleanfalseIf true, turn off SLAM tracking for efficiency. This needs to be done BEFORE XR8.run() is called.
enableLighting [Optional]BooleanfalseIf true, lighting will be provided by XR8.XrController.pipelineModule() as processCpuResult.reality.lighting
enableWorldPoints [Optional]BooleanfalseIf true, worldPoints will be provided by XR8.XrController.pipelineModule() as processCpuResult.reality.worldPoints.
imageTargets [Optional]ArrayList of names of the image target to detect. Can be modified at runtime. Note: All currently active image targets will be replaced with the ones specified in this list.
leftHandedAxes [Optional]BooleanfalseIf true, use left-handed coordinates.
mirroredDisplay [Optional]BooleanfalseIf true, flip left and right in the output.
scale [Optional]StringresponsiveEither responsive or absolute. responsive will return values so that the camera on frame 1 is at the origin defined via XR8.XrController.updateCameraProjectionMatrix(). absolute will return the camera, image targets, etc in meters. When using absolute the x-position, z-position, and rotation of the starting pose will respect the parameters set in XR8.XrController.updateCameraProjectionMatrix() once scale has been estimated. The y-position will depend on the camera's physical height from the ground plane.

IMPORTANT: disableWorldTracking: true needs to be set BEFORE both XR8.XrController.pipelineModule() and XR8.run() are called and cannot be modifed while the engine is running.

Returns

None

Example

XR8.XrController.configure({enableLighting: true, disableWorldTracking: false, scale: 'absolute'})

Example - Disable world tracking

// Disable world tracking (SLAM)
XR8.XrController.configure({disableWorldTracking: true})
// Open the camera and start running the camera run loop
XR8.run({canvas: document.getElementById('camerafeed')})

Example - Change active image target set

XR8.XrController.configure({imageTargets: ['image-target1', 'image-target2', 'image-target3']})