Skip to main content

Class: Depth

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

Constructors

Constructor

new Depth(): Depth

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

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


depthArray

depthArray: DepthArray[] = []

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


depthMesh?

optional depthMesh: DepthMesh

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


gpuDepthData

gpuDepthData: XRWebGLDepthInformation[] = []

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


height

height: number = DEFAULT_DEPTH_HEIGHT

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


occludableShaders

occludableShaders: Set<Shader>

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


options

options: DepthOptions

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


rawValueToMeters

rawValueToMeters: number = 0.0010000000474974513

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


view

view: XRView[] = []

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


width

width: number = DEFAULT_DEPTH_WIDTH

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


instance?

static optional instance: Depth

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

Methods

debugLog()

debugLog(): void

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

Returns

void


getDepth()

getDepth(u, v): number

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

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

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(view_id): undefined | DataTexture | ExternalTexture

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

Parameters

view_id

number

Returns

undefined | DataTexture | ExternalTexture


getVertex()

getVertex(u, v): null | Vector3

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

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

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

Parameters

client

object

Returns

void


renderOcclusionPass()

renderOcclusionPass(): void

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

Returns

void


resumeDepth()

resumeDepth(client): void

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

Parameters

client

object

Returns

void


update()

update(frame?): void

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

Parameters

frame?

XRFrame

Returns

void


updateCPUDepthData()

updateCPUDepthData(depthData, view_id): void

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

Parameters

depthData

XRCPUDepthInformation

view_id

number = 0

Returns

void


updateGPUDepthData()

updateGPUDepthData(depthData, view_id): void

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

Parameters

depthData

XRWebGLDepthInformation

view_id

number = 0

Returns

void


updateLocalDepth()

updateLocalDepth(frame): void

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

Parameters

frame

XRFrame

Returns

void