Skip to main content

Interface: SimulatorDepth

Defined in: src/simulator/scene/SimulatorDepth.ts:15

Properties​

autoUpdateDepthCameraProjection​

autoUpdateDepthCameraProjection: boolean = true

Defined in: src/simulator/scene/SimulatorDepth.ts:30

If true, copies the rendering camera's projection matrix each frame.


autoUpdateDepthCameraTransform​

autoUpdateDepthCameraTransform: boolean = true

Defined in: src/simulator/scene/SimulatorDepth.ts:34

If true, copies the rendering camera's transform each frame.


depthBuffer​

depthBuffer: Float32Array

Defined in: src/simulator/scene/SimulatorDepth.ts:23


depthCamera​

depthCamera: Camera

Defined in: src/simulator/scene/SimulatorDepth.ts:26


depthHeight​

depthHeight: number = 160

Defined in: src/simulator/scene/SimulatorDepth.ts:21


depthRenderTarget​

depthRenderTarget: WebGLRenderTarget

Defined in: src/simulator/scene/SimulatorDepth.ts:22


depthWidth​

depthWidth: number = 160

Defined in: src/simulator/scene/SimulatorDepth.ts:20


maxDepthAgeMs​

maxDepthAgeMs: number = 500

Defined in: src/simulator/scene/SimulatorDepth.ts:65

Longest a depth buffer is allowed to go without being refreshed while nothing detectable has changed, in milliseconds.

This is not only a hedge against animation the skip cannot see, such as skinning or vertex shaders. It is also what keeps the depth mesh's position attribute version advancing while the scene sits still. FaceRecognizer, HumanRecognizer, and ObjectDetector each cache a cloned depth mesh, and its BVH, keyed on that version. If this were removed, a stationary scene would freeze the version, those caches would never invalidate, and per-landmark raycasts would keep hitting a stale clone. That is the failure this repository already fixed once, where the face wireframe only appeared while the camera was moving.

Raising it trades depth freshness for fewer readbacks; setting it to Infinity would reintroduce that bug.

Accessors​

depthMaterial​

Get Signature​

get depthMaterial(): Material

Defined in: src/simulator/scene/SimulatorDepth.ts:79

Returns​

Material

Methods​

createRenderTarget()​

createRenderTarget(): void

Defined in: src/simulator/scene/SimulatorDepth.ts:117

Returns​

void


dispose()​

dispose(): void

Defined in: src/simulator/scene/SimulatorDepth.ts:279

Returns​

void


init()​

init(renderer, camera, depth): Promise<void>

Defined in: src/simulator/scene/SimulatorDepth.ts:86

Initialize Simulator Depth.

Parameters​

renderer​

WebGLOrWebGPURenderer

camera​

Camera

depth​

Depth

Returns​

Promise<void>


update()​

update(): void

Defined in: src/simulator/scene/SimulatorDepth.ts:129

Returns​

void