Skip to main content

Interface: SimulatorDepth

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

Properties

autoUpdateDepthCameraProjection

autoUpdateDepthCameraProjection: boolean = true

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

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


autoUpdateDepthCameraTransform

autoUpdateDepthCameraTransform: boolean = true

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

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


depthBuffer

depthBuffer: Float32Array

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


depthBufferSlice

depthBufferSlice: Float32Array<ArrayBuffer>

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


depthCamera

depthCamera: Camera

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


depthHeight

depthHeight: number = 160

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


depthMaterial

depthMaterial: SimulatorDepthMaterial

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


depthRenderTarget

depthRenderTarget: WebGLRenderTarget

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


depthWidth

depthWidth: number = 160

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


maxDepthAgeMs

maxDepthAgeMs: number = 500

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

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.

Methods

createRenderTarget()

createRenderTarget(): void

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

Returns

void


dispose()

dispose(): void

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

Returns

void


init()

init(renderer, camera, depth): void

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

Initialize Simulator Depth.

Parameters

renderer

WebGLRenderer

camera

Camera

depth

Depth

Returns

void


update()

update(): void

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

Returns

void