Class: DepthMesh
Defined in: src/depth/DepthMesh.ts:11
Extends
Constructors
Constructor
new DepthMesh(
depthOptions,width,height,depthTextures?):DepthMesh
Defined in: src/depth/DepthMesh.ts:51
Parameters
depthOptions
width
number
height
number
depthTextures?
Returns
DepthMesh
Overrides
Properties
downsampledGeometry?
optionaldownsampledGeometry:BufferGeometry<NormalBufferAttributes,BufferGeometryEventMap>
Defined in: src/depth/DepthMesh.ts:26
downsampledMesh?
optionaldownsampledMesh:Mesh<BufferGeometry<NormalBufferAttributes,BufferGeometryEventMap>,Material|Material[],Object3DEventMap>
Defined in: src/depth/DepthMesh.ts:27
ignoreReticleRaycast
ignoreReticleRaycast:
boolean=false
Defined in: src/depth/DepthMesh.ts:16
isXRScript
isXRScript:
boolean=true
Defined in: src/core/Script.ts:54
Inherited from
ux
ux:
UX
Defined in: src/core/Script.ts:53
Inherited from
dependencies
staticdependencies:object
Defined in: src/depth/DepthMesh.ts:12
renderer
renderer: typeof
WebGLRenderer=THREE.WebGLRenderer
isDepthMesh
staticisDepthMesh:boolean=true
Defined in: src/depth/DepthMesh.ts:15
Methods
convertGPUToGPU()
convertGPUToGPU(
depthData):XRCPUDepthInformation
Defined in: src/depth/DepthMesh.ts:211
Parameters
depthData
Readonly<XRWebGLDepthInformation>
Returns
dispose()
dispose():
void
Defined in: src/core/Script.ts:196
Called when the script is removed from the scene. Opposite of init.
Returns
void
Inherited from
getColliderFromHandle()
getColliderFromHandle(
handle):undefined|Collider
Defined in: src/depth/DepthMesh.ts:477
Parameters
handle
number
Returns
undefined | Collider
init()
init(
__namedParameters):void
Defined in: src/depth/DepthMesh.ts:139
Initialize the depth mesh.
Parameters
__namedParameters
renderer
Returns
void
Overrides
initPhysics()
initPhysics(
_physics):void|Promise<void>
Defined in: src/core/Script.ts:73
Enables depth-aware interactions with physics. See /demos/ballpit
Parameters
_physics
Returns
void | Promise<void>
Inherited from
initRapierPhysics()
initRapierPhysics(
RAPIER,blendedWorld):void
Defined in: src/depth/DepthMesh.ts:413
Parameters
RAPIER
__module
blendedWorld
World
Returns
void
onHoverEnter()
onHoverEnter(
_controller):boolean|void
Defined in: src/core/Script.ts:155
Called when the controller starts hovering over this object with reticle.
Parameters
_controller
An XR controller.
Returns
boolean | void
Whether the event was handled. If true, the event will not bubble up.
Inherited from
onHoverExit()
onHoverExit(
_controller):boolean|void
Defined in: src/core/Script.ts:161
Called when the controller hovers over this object with reticle.
Parameters
_controller
An XR controller.
Returns
boolean | void
Whether the event was handled. If true, the event will not bubble up.
Inherited from
onHovering()
onHovering(
_controller):boolean|void
Defined in: src/core/Script.ts:167
Called when the controller hovers over this object with reticle.
Parameters
_controller
An XR controller.
Returns
boolean | void
Whether the event was handled. If true, the event will not bubble up.
Inherited from
onKeyDown()
onKeyDown(
_event):void
Defined in: src/core/Script.ts:110
Called on keyboard keypress.
Parameters
_event
Event containing .code to read the keyboard key.
Returns
void
Inherited from
onKeyUp()
onKeyUp(
_event):void
Defined in: src/core/Script.ts:111
Parameters
_event
Returns
void
Inherited from
onObjectGrabbing()
onObjectGrabbing(
_event):void
Defined in: src/core/Script.ts:187
Called every frame a hand is grabbing this object.
Parameters
_event
Returns
void
Inherited from
onObjectGrabEnd()
onObjectGrabEnd(
_event):void
Defined in: src/core/Script.ts:191
Called when a hand stops grabbing this object.
Parameters
_event
Returns
void
Inherited from
onObjectGrabStart()
onObjectGrabStart(
_event):void
Defined in: src/core/Script.ts:183
Called when a hand starts grabbing this object (touching + pinching).
Parameters
_event
Returns
void
Inherited from
onObjectSelectEnd()
onObjectSelectEnd(
_event):boolean|void
Defined in: src/core/Script.ts:149
Called when the controller stops selecting this object the script represents, e.g. View, ModelView.
Parameters
_event
event.target holds its controller.
Returns
boolean | void
Whether the event was handled. If true, the event will not bubble up.
Inherited from
onObjectSelectStart()
onObjectSelectStart(
_event):boolean|void
Defined in: src/core/Script.ts:142
Called when the controller starts selecting this object the script represents, e.g. View, ModelView.
Parameters
_event
event.target holds its controller.
Returns
boolean | void
Whether the event was handled. If true, the event will not bubble up.
Inherited from
MeshScript.onObjectSelectStart
onObjectTouchEnd()
onObjectTouchEnd(
_event):void
Defined in: src/core/Script.ts:179
Called when a hand's index finger stops touching this object.
Parameters
_event
Returns
void
Inherited from
onObjectTouching()
onObjectTouching(
_event):void
Defined in: src/core/Script.ts:175
Called every frame that a hand's index finger is touching this object.
Parameters
_event
Returns
void
Inherited from
onObjectTouchStart()
onObjectTouchStart(
_event):void
Defined in: src/core/Script.ts:171
Called when a hand's index finger starts touching this object.
Parameters
_event
Returns
void
Inherited from
onSelect()
onSelect(
_event):void
Defined in: src/core/Script.ts:99
Called whenever pinch / mouse click successfully completes, globally.
Parameters
_event
event.target holds its controller.
Returns
void
Inherited from
onSelectEnd()
onSelectEnd(
_event):void
Defined in: src/core/Script.ts:93
Called whenever pinch / mouse click discontinues, globally.
Parameters
_event
event.target holds its controller
Returns
void
Inherited from
onSelecting()
onSelecting(
_event):void
Defined in: src/core/Script.ts:104
Called whenever pinch / mouse click is happening, globally.
Parameters
_event
Returns
void
Inherited from
onSelectStart()
onSelectStart(
_event):void
Defined in: src/core/Script.ts:87
Called whenever pinch / mouse click starts, globally.
Parameters
_event
event.target holds its controller
Returns
void
Inherited from
onSimulatorStarted()
onSimulatorStarted():
void
Defined in: src/core/Script.ts:79
Returns
void
Inherited from
onSqueeze()
onSqueeze(
_event):void
Defined in: src/core/Script.ts:133
Called whenever gamepad trigger successfully completes, globally.
Parameters
_event
event.target holds its controller.
Returns
void
Inherited from
onSqueezeEnd()
onSqueezeEnd(
_event):void
Defined in: src/core/Script.ts:122
Called whenever gamepad trigger stops, globally.
Parameters
_event
event.target holds its controller.
Returns
void
Inherited from
onSqueezeStart()
onSqueezeStart(
_event):void
Defined in: src/core/Script.ts:117
Called whenever gamepad trigger starts, globally.
Parameters
_event
event.target holds its controller.
Returns
void
Inherited from
onSqueezing()
onSqueezing(
_event):void
Defined in: src/core/Script.ts:127
Called whenever gamepad is being triggered, globally.
Parameters
_event
Returns
void
Inherited from
onXRSessionEnded()
onXRSessionEnded():
void
Defined in: src/core/Script.ts:77
Returns
void
Inherited from
onXRSessionStarted()
onXRSessionStarted(
_session?):void
Defined in: src/core/Script.ts:76
Parameters
_session?
Returns
void
Inherited from
physicsStep()
physicsStep():
void
Defined in: src/core/Script.ts:74
Returns
void
Inherited from
raycast()
raycast(
raycaster,intersects):boolean
Defined in: src/depth/DepthMesh.ts:450
Customizes raycasting to compute normals for intersections.
Parameters
raycaster
The raycaster object.
intersects
Intersection<Object3D<Object3DEventMap>>[]
Array to store intersections.
Returns
boolean
- True if intersections are found.
Overrides
MeshScript.raycast
update()
update(
_time?,_frame?):void
Defined in: src/core/Script.ts:68
Runs per frame.
Parameters
_time?
number
_frame?
Returns
void
Inherited from
updateDepth()
updateDepth(
depthData,projectionMatrixInverse):void
Defined in: src/depth/DepthMesh.ts:147
Updates the depth data and geometry positions based on the provided camera and depth data.
Parameters
depthData
Readonly<XRCPUDepthInformation>
projectionMatrixInverse
Returns
void
updateFullResolutionGeometry()
updateFullResolutionGeometry(
depthData):void
Defined in: src/depth/DepthMesh.ts:307
Method to manually update the full resolution geometry. Only needed if options.updateFullResolutionGeometry is false.
Parameters
depthData
Returns
void
updateGPUDepth()
updateGPUDepth(
depthData,projectionMatrixInverse):void
Defined in: src/depth/DepthMesh.ts:204
Parameters
depthData
Readonly<XRWebGLDepthInformation>
projectionMatrixInverse
Returns
void
updatePose()
updatePose(
translation,quaternion):void
Defined in: src/depth/DepthMesh.ts:194
Parameters
translation
quaternion
Returns
void