Skip to main content

Class: Depth

Defined in: src/depth/Depth.ts:18

Constructors

Constructor

new Depth(): Depth

Defined in: src/depth/Depth.ts:59

Depth is a lightweight manager based on three.js to simply prototyping with Depth in WebXR.

Returns

Depth

Properties

cpuDepthData

cpuDepthData: XRCPUDepthInformation[] = []

Defined in: src/depth/Depth.ts:28


depthArray

depthArray: DepthArray[] = []

Defined in: src/depth/Depth.ts:30


depthMesh?

optional depthMesh: DepthMesh

Defined in: src/depth/Depth.ts:31


depthProjectionMatrices

depthProjectionMatrices: Matrix4[] = []

Defined in: src/depth/Depth.ts:51


depthViewMatrices

depthViewMatrices: Matrix4[] = []

Defined in: src/depth/Depth.ts:52


depthViewProjectionMatrices

depthViewProjectionMatrices: Matrix4[] = []

Defined in: src/depth/Depth.ts:53


gpuDepthData

gpuDepthData: XRWebGLDepthInformation[] = []

Defined in: src/depth/Depth.ts:29


height

height: number = DEFAULT_DEPTH_HEIGHT

Defined in: src/depth/Depth.ts:35


occludableShaders

occludableShaders: Set<Shader>

Defined in: src/depth/Depth.ts:44


options

options: DepthOptions

Defined in: src/depth/Depth.ts:33


view

view: XRView[] = []

Defined in: src/depth/Depth.ts:27


width

width: number = DEFAULT_DEPTH_WIDTH

Defined in: src/depth/Depth.ts:34


instance?

static optional instance: Depth

Defined in: src/depth/Depth.ts:19

Accessors

rawValueToMeters

Get Signature

get rawValueToMeters(): number

Defined in: src/depth/Depth.ts:36

Returns

number

Methods

debugLog()

debugLog(): void

Defined in: src/depth/Depth.ts:371

Returns

void


getDepth()

getDepth(u, v): number

Defined in: src/depth/Depth.ts:113

Retrieves the depth at normalized coordinates (u, v).

Parameters

u

number

Normalized horizontal coordinate.

v

number

Normalized vertical coordinate.

Returns

number

Depth value at the specified coordinates.


getProjectedDepthViewPositionFromWorldPosition()

getProjectedDepthViewPositionFromWorldPosition(position, target): Vector3

Defined in: src/depth/Depth.ts:128

Projects the given world position to clip space and then to view space using the depth.

Parameters

position

Vector3

The world position to project.

target

Vector3 = ...

Returns

Vector3


getTexture()

getTexture(viewId): undefined | DataTexture | ExternalTexture

Defined in: src/depth/Depth.ts:271

Parameters

viewId

number

Returns

undefined | DataTexture | ExternalTexture


getVertex()

getVertex(u, v): null | Vector3

Defined in: src/depth/Depth.ts:152

Retrieves the depth at normalized coordinates (u, v).

Parameters

u

number

Normalized horizontal coordinate.

v

number

Normalized vertical coordinate.

Returns

null | Vector3

Vertex at (u, v)


init()

init(camera, options, renderer, registry, scene): void

Defined in: src/depth/Depth.ts:69

Initialize Depth manager.

Parameters

camera

PerspectiveCamera

options

DepthOptions

renderer

WebGLRenderer

registry

Registry

scene

Scene

Returns

void


pauseDepth()

pauseDepth(client): void

Defined in: src/depth/Depth.ts:388

Parameters

client

object

Returns

void


renderOcclusionPass()

renderOcclusionPass(): void

Defined in: src/depth/Depth.ts:338

Returns

void


resumeDepth()

resumeDepth(client): void

Defined in: src/depth/Depth.ts:383

Parameters

client

object

Returns

void


update()

update(frame?): void

Defined in: src/depth/Depth.ts:276

Parameters

frame?

XRFrame

Returns

void


updateCPUDepthData()

updateCPUDepthData(depthData, viewId): void

Defined in: src/depth/Depth.ts:197

Parameters

depthData

XRCPUDepthInformation

viewId

number = 0

Returns

void


updateGPUDepthData()

updateGPUDepthData(depthData, viewId): void

Defined in: src/depth/Depth.ts:228

Parameters

depthData

XRWebGLDepthInformation

viewId

number = 0

Returns

void


updateLocalDepth()

updateLocalDepth(frame): void

Defined in: src/depth/Depth.ts:286

Parameters

frame

XRFrame

Returns

void