Class XRFrame
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalXRFrame object is passed into the RequestAnimationFrame(XRFrameRequestCallback) callback function and provides access to the information needed in order to render a single frame of animation for an XRSession describing a VR or AR scene. Events which communicate the tracking state of objects also provide an XRFrame reference as part of their structure.
[Value("XRFrame")]
public class XRFrame
- Inheritance
-
XRFrame
- Inherited Members
Remarks
In addition to providing a reference to the XRSession for which this frame is to be rendered, the GetViewerPose(XRReferenceSpace) method is provided to obtain the XRViewerPose describing the viewer's position and orientation in space, and GetPose(XRSpace, XRSpace) can be used to create an XRPose describing the relative position of one XRSpace relative to another.
Constructors
XRFrame()
public XRFrame()
Properties
DetectedMeshes
[Value("detectedMeshes")]
public XRMeshSet DetectedMeshes { get; }
Property Value
DetectedPlanes
[Value("detectedPlanes")]
public XRPlaneSet DetectedPlanes { get; }
Property Value
PredictedDisplayTime
[Value("predictedDisplayTime")]
public Number PredictedDisplayTime { get; }
Property Value
Session
NOTE
ExperimentalXRFrame object's read-only session property returns the XRSession object that generated the frame.
[Value("session")]
public XRSession Session { get; }
Property Value
- XRSession
A XRSession object representing the WebXR session for which
thisXRFramedescribes the object positions and orientations.
Remarks
TrackedAnchors
NOTE
ExperimentaltrackedAnchor property of the XRFrame interface returns an XRAnchorSet object containing all anchors still tracked in the frame.
[Value("trackedAnchors")]
public XRAnchorSet TrackedAnchors { get; }
Property Value
- XRAnchorSet
An XRAnchorSet object.
Remarks
Methods
CreateAnchor(XRRigidTransform, XRSpace)
NOTE
ExperimentalcreateAnchor() method of the XRFrame interface creates a free-floating XRAnchor which will be fixed relative to the real world.
[Value("createAnchor")]
public Task<XRAnchor> CreateAnchor(XRRigidTransform pose, XRSpace space)
Parameters
poseXRRigidTransformspaceXRSpace
Returns
Remarks
See CreateAnchor() for creating an anchor from a hit test result that is attached to a real-world object.
FillJointRadii(List<XRJointSpace>, Float32Array)
NOTE
ExperimentalfillJointRadii() method of the XRFrame interface populates a {{jsxref("Float32Array")}} with radii for a list of hand joint spaces and returns true if successful for all spaces.
[Value("fillJointRadii")]
public bool FillJointRadii(List<XRJointSpace> jointSpaces, Float32Array radii)
Parameters
jointSpacesList<XRJointSpace>radiiFloat32Array
Returns
- bool
A boolean indicating if all of the spaces have a valid pose.
Remarks
FillPoses(List<XRSpace>, XRSpace, Float32Array)
NOTE
ExperimentalfillPoses() method of the XRFrame interface populates a {{jsxref("Float32Array")}} with the matrices of the poses relative to a given base space and returns true if successful for all spaces.
[Value("fillPoses")]
public bool FillPoses(List<XRSpace> spaces, XRSpace baseSpace, Float32Array transforms)
Parameters
spacesList<XRSpace>baseSpaceXRSpacetransformsFloat32Array
Returns
- bool
A boolean indicating if all of the spaces have a valid pose.
Remarks
GetDepthInformation(XRView)
NOTE
ExperimentalgetDepthInformation() method of the XRFrame interface returns an XRCPUDepthInformation object containing CPU depth information for the active and animated frame.
[Value("getDepthInformation")]
public XRCPUDepthInformation? GetDepthInformation(XRView view)
Parameters
viewXRView
Returns
- XRCPUDepthInformation
An XRCPUDepthInformation object.
Remarks
GetHitTestResults(XRHitTestSource)
NOTE
ExperimentalgetHitTestResults() method of the XRFrame interface returns an array of XRHitTestResult objects containing hit test results for a given XRHitTestSource.
[Value("getHitTestResults")]
public List<XRHitTestResult> GetHitTestResults(XRHitTestSource hitTestSource)
Parameters
hitTestSourceXRHitTestSource
Returns
- List<XRHitTestResult>
An array of XRHitTestResult objects.
Remarks
GetHitTestResultsForTransientInput(XRTransientInputHitTestSource)
NOTE
ExperimentalgetHitTestResultsForTransientInput() method of the XRFrame interface returns an array of XRTransientInputHitTestResult objects containing transient input hit test results for a given XRTransientInputHitTestSource.
[Value("getHitTestResultsForTransientInput")]
public List<XRTransientInputHitTestResult> GetHitTestResultsForTransientInput(XRTransientInputHitTestSource hitTestSource)
Parameters
hitTestSourceXRTransientInputHitTestSource
Returns
- List<XRTransientInputHitTestResult>
An array of XRTransientInputHitTestResult objects.
Remarks
GetJointPose(XRJointSpace, XRSpace)
NOTE
ExperimentalgetJointPose() method of the XRFrame interface returns an XRJointPose object providing the pose of a hand joint (see XRHand) relative to a given base space.
[Value("getJointPose")]
public XRJointPose? GetJointPose(XRJointSpace joint, XRSpace baseSpace)
Parameters
jointXRJointSpacebaseSpaceXRSpace
Returns
- XRJointPose
An XRJointPose object specifying the position and orientation of the hand joint, relative to
the XRSpace indicated bybaseSpace.
Remarks
GetLightEstimate(XRLightProbe)
NOTE
ExperimentalgetLightEstimate() method of the XRFrame interface returns an XRLightEstimate object containing estimated lighting values for a given XRLightProbe.
[Value("getLightEstimate")]
public XRLightEstimate? GetLightEstimate(XRLightProbe lightProbe)
Parameters
lightProbeXRLightProbe
Returns
- XRLightEstimate
An XRLightEstimate object or
nullif the device cannot estimate lighting for this frame.
Remarks
GetPose(XRSpace, XRSpace)
NOTE
ExperimentalgetPose() returns the relative position andorientation—the pose—of one XRSpace to that of another space. With this, you can observe the motion of objects relative to each other and to fixed locations throughout the scene.
[Value("getPose")]
public XRPose? GetPose(XRSpace space, XRSpace baseSpace)
Parameters
Returns
- XRPose
An XRPose object specifying the position and orientation, relative to
the XRSpace indicated bybaseSpace.
Remarks
For example, to get the position of a controller relative to the viewer's head, you would compare the controller's GripSpace to the XRReferenceSpace of type viewer.
GetViewerPose(XRReferenceSpace)
NOTE
ExperimentalgetViewerPose() method, a member of the XRFrame interface, returns a XRViewerPose object which describes the viewer's pose (position and orientation) relative to the specified reference space.
[Value("getViewerPose")]
public XRViewerPose? GetViewerPose(XRReferenceSpace referenceSpace)
Parameters
referenceSpaceXRReferenceSpace
Returns
- XRViewerPose
A XRViewerPose describing the viewer's position and orientation relative
to the specified reference space.
Remarks
See the GetPose(XRSpace, XRSpace) method for a way to calculate a pose that represents the difference between two spaces.