Class XRRay
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalXRRay interface of the WebXR Device API is a geometric ray described by an origin point and a direction vector.
[Value("XRRay")]
public class XRRay
- Inheritance
-
XRRay
- Inherited Members
Remarks
XRRay objects can be passed to RequestHitTestSource(XRHitTestOptionsInit) or RequestHitTestSourceForTransientInput(XRTransientInputHitTestOptionsInit) to perform hit testing.
Constructors
XRRay()
public XRRay()
XRRay(DOMPointInit, XRRayDirectionInit)
NOTE
ExperimentalXRRay() constructor creates a new XRRay object which is a geometric ray described by an origin point and a direction vector.
public XRRay(DOMPointInit origin = null, XRRayDirectionInit direction = null)
Parameters
originDOMPointInitdirectionXRRayDirectionInit
Remarks
XRRay(XRRigidTransform)
NOTE
ExperimentalXRRay() constructor creates a new XRRay object which is a geometric ray described by an origin point and a direction vector.
public XRRay(XRRigidTransform transform)
Parameters
transformXRRigidTransform
Remarks
Properties
Direction
NOTE
Experimentaldirection property of the XRRay interface is a DOMPointReadOnly representing the ray's 3-dimensional directional vector, normalized to a unit vector with a length of 1.0.
[Value("direction")]
public DOMPointReadOnly Direction { get; }
Property Value
- DOMPointReadOnly
A DOMPointReadOnly object.
Remarks
Matrix
NOTE
Experimentalmatrix property of the XRRay interface is a transform that can be used to position objects along the XRRay. This is a 4 by 4 matrix given as a 16 element Float32Array in column major order.
[Value("matrix")]
public Float32Array Matrix { get; }
Property Value
- Float32Array
A 16 element Float32Array object representing a 4 by 4 matrix in column major order.
Remarks
The transform from a ray originates at [0, 0, 0] and extends down the negative z-axis to the ray described by the XRRay's origin and direction.
Origin
NOTE
Experimentalorigin property of the XRRay interface is a DOMPointReadOnly representing the 3-dimensional point in space that the ray originates from, in meters.
[Value("origin")]
public DOMPointReadOnly Origin { get; }
Property Value
- DOMPointReadOnly
A DOMPointReadOnly object.