Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions docs/api/en/renderers/webxr/WebXRManager.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,24 @@ <h3>[property:Boolean isPresenting]</h3>
</p>

<h2>Methods</h2>

<h3>[method:XRWebGLLayer getBaseLayer]()</h3>
<p>
Returns the current base layer. This is an
[link:https://developer.mozilla.org/en-US/docs/Web/API/XRProjectionLayer XRProjectionLayer]
when the targeted XR device supports the
[link:https://www.w3.org/TR/webxrlayers-1/ WebXR Layers API], or an
[link:https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer XRWebGLLayer]
if it doesn't.
</p>

<h3>[method:XRWebGLBinding getBinding]()</h3>
<p>
Returns the current
[link:https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLBinding XRWebGLBinding].<br /><br />

This method will create a new `XRWebGLBinding` if the browser is able to and one hasn't been created yet.
</p>

<h3>[method:ArrayCamera getCamera]()</h3>
<p>
Expand All @@ -50,6 +68,18 @@ <h3>[method:ArrayCamera getCamera]()</h3>
manually from the XR camera's projection matrices.
</p>

<h3>[method:Texture getCameraTexture]( [param:XRCamera xrCamera] )</h3>
<p>
[page:XRCamera xrCamera] — The
[link:https://immersive-web.github.io/raw-camera-access/#xr-camera-section XRCamera]
to query.<br /><br />

Returns an opaque texture from the queried `XRCamera`.
Only available during the current animation loop.<br /><br />

See the [example:webxr_ar_camera_access webxr / ar / camera_access] example.
</p>

<h3>[method:Group getController]( [param:Integer index] )</h3>
<p>
[page:Integer index] — The index of the controller. <br /><br />
Expand All @@ -76,13 +106,31 @@ <h3>[method:Group getControllerGrip]( [param:Integer index] )</h3>
different groups in two different coordinate spaces for the same WebXR
controller.
</p>

<h3>[method:Mesh getDepthSensingMesh]()</h3>
<p>
Returns a plane mesh that visualizes the depth sensing texture
if one is available, and `null` otherwise.
</p>

<h3>[method:ExternalTexture getDepthTexture]()</h3>
<p>
Returns a texture representing the computed depth of the
user's environment if available, and `null` otherwise.
</p>

<h3>[method:Float getFoveation]()</h3>
<p>
Returns the amount of foveation used by the XR compositor for the
projection layer.
</p>

<h3>[method:XRFrame getFrame]()</h3>
<p>
Returns the current [link:https://developer.mozilla.org/en-US/docs/Web/API/XRFrame XRFrame].
Will return `null` if used without an ongoing XR session.
</p>

<h3>[method:Group getHand]( [param:Integer index] )</h3>
<p>
[page:Integer index] — The index of the controller. <br /><br />
Expand All @@ -101,6 +149,11 @@ <h3>[method:XRSession getSession]()</h3>
of active WebXR sessions on application level.
</p>

<h3>[method:Boolean hasDepthSensing]()</h3>
<p>
Returns `true` if depth sensing data has been provided by the XR device.
</p>

<h3>[method:undefined setFoveation]( [param:Float foveation] )</h3>
<p>
[page:Float foveation] — The foveation to set.<br /><br />
Expand Down
9 changes: 8 additions & 1 deletion src/renderers/webxr/WebXRManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ class WebXRManager extends EventDispatcher {
/**
* Returns the current base layer.
*
* This is an `XRProjectionLayer` when the targeted XR device supports the
* WebXR Layers API, or an `XRWebGLLayer` otherwise.
*
* @return {?(XRWebGLLayer|XRProjectionLayer)} The XR base layer.
*/
this.getBaseLayer = function () {
Expand Down Expand Up @@ -533,6 +536,8 @@ class WebXRManager extends EventDispatcher {
/**
* Returns the current depth texture computed via depth sensing.
*
* See {@link WebXRDepthSensing#getDepthTexture}.
*
* @return {?Texture} The depth texture.
*/
this.getDepthTexture = function () {
Expand Down Expand Up @@ -703,7 +708,7 @@ class WebXRManager extends EventDispatcher {

/**
* Updates the state of the XR camera. Use this method on app level if you
* set cameraAutoUpdate` to `false`. The method requires the non-XR
* set `cameraAutoUpdate` to `false`. The method requires the non-XR
* camera of the scene as a parameter. The passed in camera's transformation
* is automatically adjusted to the position of the XR camera when calling
* this method.
Expand Down Expand Up @@ -880,6 +885,8 @@ class WebXRManager extends EventDispatcher {
/**
* Returns the depth sensing mesh.
*
* See {@link WebXRDepthSensing#getMesh}.
*
* @return {Mesh} The depth sensing mesh.
*/
this.getDepthSensingMesh = function () {
Expand Down
Loading