Table of Contents

Class XRRay

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The XRRay 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

Constructors

XRRay()

public XRRay()

XRRay(DOMPointInit, XRRayDirectionInit)

NOTE
Experimental
The XRRay() 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

origin DOMPointInit
direction XRRayDirectionInit

Remarks

XRRay(XRRigidTransform)

NOTE
Experimental
The XRRay() 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

transform XRRigidTransform

Remarks

Properties

Direction

NOTE
Experimental
The read-only direction 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
Experimental
The read-only matrix 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.

-Float32Array

See also on MDN

Origin

NOTE
Experimental
The read-only origin 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.

Remarks