Class XRBoundedReferenceSpace
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalXRBoundedReferenceSpace interface describes a virtual world reference space which has preset boundaries. This extends XRReferenceSpace, which describes an essentially unrestricted space around the viewer's position. These bounds are defined using an array of points, each of which defines a vertex in a polygon inside which the user is allowed to move.
[Value("XRBoundedReferenceSpace")]
public class XRBoundedReferenceSpace : XRReferenceSpace
- Inheritance
-
XRBoundedReferenceSpace
- Inherited Members
Remarks
This is typically used when the XR system is capable of tracking the user's physical movement within a limited distance of their starting position. The specified bounds may, in fact, describe the shape and size of the room the user is located in, in order to let the WebXR site or application prevent the user from colliding with the walls or other obstacles in the real world. At a minimum, the boundaries indicate the area in which the XR device is capable of tracking the user's movement. See the article Using bounded reference spaces for details on how bounded spaces work and why they're useful.
-WebXR Device API
-Geometry and reference spaces in WebXR
-Viewpoints and viewers: simulating cameras in WebXR
Constructors
XRBoundedReferenceSpace()
public XRBoundedReferenceSpace()
Properties
BoundsGeometry
NOTE
Experimentalproperty
boundsGeometry is an array ofDOMPointReadOnly objects which specifies the points making up a polygon
inside which the viewer is allowed to move. Each point is treated as a
two-dimensional point, and must be located at ground level (that is,
its
y coordinate must be 0).
[Value("boundsGeometry")]
public DOMPointReadOnly[] BoundsGeometry { get; }
Property Value
- DOMPointReadOnly[]
The
boundsGeometryproperty is an array of DOMPointReadOnly
objects, each of which defines one vertex in a polygon inside which the viewer is
required to remain. Each point must be at floor level, with
itsycoordinate's value set to 0. Additionally, the value
ofwis always 1 in every point in the array. Additionally, the
points must be listed in clockwise order.Each entry inboundsGeometryis equal to an entry in the list of native
bounds geometry points for the room, premultiplied by the inverse of the origin offset.
In other words, the bounds are the physical limitations of the available space, shifted
so that the reference space's bounds points are all defined relative to theXRBoundedReferenceSpace's effective origin.
Remarks
This boundary is typically configured by the user, using the software that controls
their XR hardware. This may be done by walking the border of the space they wish to use,
or by drawing the shape of their room using their XR input device. Theoretically, a more
advanced system might use sensors or other detection methods to determine the bounds of
a dedicated XR room (notice how we carefully don't call it a holodeck?).