Capítulo 789 de 859

Chapter 789: WebXRDepthSensing

Core Idea

A XR module that manages the access to the Depth Sensing API.

Key Concepts

  • depthFar : number: The depth near far.
  • depthNear : number: The depth near value.
  • mesh : Mesh: A plane mesh for visualizing the depth texture.
  • texture : ExternalTexture: An opaque texture representing the depth of the user's environment.

Reference Tables

Constructor

Signature
new WebXRDepthSensing()

Properties

PropertyDescription
.depthFar : numberThe depth near far.
.depthNear : numberThe depth near value.
.mesh : MeshA plane mesh for visualizing the depth texture.
.texture : ExternalTextureAn opaque texture representing the depth of the user's environment.

Methods

MethodDescription
.getDepthTexture() : ExternalTextureReturns a texture representing the depth of the user's environment.
.getMesh( cameraXR : ArrayCamera ) : MeshReturns a plane mesh that visualizes the depth texture.
.init( depthData : XRWebGLDepthInformation, renderState : XRRenderState )Inits the depth sensing module
.reset()Resets the module

Key Takeaways

  1. Most relevant properties: depthFar, depthNear, mesh, texture.
  2. Key methods: getDepthTexture, getMesh, init, reset.

Connects To