diff --git a/index.html b/index.html index afa0c43..81cdcaf 100644 --- a/index.html +++ b/index.html @@ -5,10 +5,9 @@ WebXR Hit Test Module - - + - + - - + - + - + - + - - - + + - + - - +

WebXR Hit Test Module

-

Editor’s Draft,

+

Editor’s Draft,

More details about this document
@@ -722,7 +965,7 @@

WebXR Hit Test Module

- +
@@ -741,12 +984,12 @@

Publication as an Editors' Draft does not imply endorsement by W3C and its Members. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

-

This document was produced by a group operating under the 1 August 2017 W3C Patent Policy. W3C maintains a public list of any - patent disclosures made in connection with the deliverables of the group; that page also - includes instructions for disclosing a patent. An individual who has actual knowledge of a - patent which the individual believes contains Essential - Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

-

This document is governed by the 2 November 2021 W3C Process Document.

+

This document was produced by a group operating under the W3C Patent Policy. + W3C maintains a public list of any patent + disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential + Claim(s) must disclose the information in accordance with section + 6 of the W3C Patent Policy.

+

This document is governed by the 03 November 2023 W3C Process Document.

@@ -861,7 +1104,7 @@

An XRHitTestOptionsInit dictionary represents a set of configurable values that affect the behavior of the hit test being performed.

dictionary XRHitTestOptionsInit {
   required XRSpace space;
-  FrozenArray<XRHitTestTrackableType> entityTypes;
+  sequence<XRHitTestTrackableType> entityTypes;
   XRRay offsetRay;
 };
 
@@ -874,7 +1117,7 @@

XRTransientInputHitTestOptionsInit dictionary represents a set of configurable values that affect the behavior of the hit test for transient input that is being performed.

dictionary XRTransientInputHitTestOptionsInit {
   required DOMString profile;
-  FrozenArray<XRHitTestTrackableType> entityTypes;
+  sequence<XRHitTestTrackableType> entityTypes;
   XRRay offsetRay;
 };
 
@@ -885,22 +1128,6 @@

XRTransientInputHitTestOptionsInit dictionary has an associated effective offsetRay which is set to offsetRay if it was provided at dictionary construction time. If the offsetRay was not provided at construction time, the effective offsetRay is set to an XRRay constructed by invoking XRRay() without any parameters.

4. Hit test source

4.1. XRHitTestSource

-
- -
-

XRHitTestSource

-

In only one current engine.

-
- FirefoxNoneSafariNoneChrome81+ -
- OperaNoneEdge81+ -
- Edge (Legacy)NoneIENone -
- Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
-
-
[SecureContext, Exposed=Window]
 interface XRHitTestSource {
   undefined cancel();
@@ -931,22 +1158,6 @@ 

Return hitTestSource.

-
- -
-

XRHitTestSource/cancel

-

In only one current engine.

-
- FirefoxNoneSafariNoneChrome81+ -
- OperaNoneEdge81+ -
- Edge (Legacy)NoneIENone -
- Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
-
-

The cancel() method, when invoked on XRHitTestSource hitTestSource, signals that the application is no longer interested in obtaining hit test results for the specified hitTestSource.

When cancel() method is invoked, the user agent MUST cancel a hit test source by running the following steps:

@@ -959,22 +1170,6 @@

When the application no longer retains any references to a particular XRHitTestSource hitTestSource, the user agent MAY cancel a hit test source if hitTestSource is still active. The cancelation MAY happen at an unspecified time (or not at all) and the application SHOULD NOT rely on this behavior for cleanup.

4.2. XRTransientInputHitTestSource

-
- -
-

XRTransientInputHitTestSource

-

In only one current engine.

-
- FirefoxNoneSafariNoneChrome81+ -
- OperaNoneEdge81+ -
- Edge (Legacy)NoneIENone -
- Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
-
-
[SecureContext, Exposed=Window]
 interface XRTransientInputHitTestSource {
   undefined cancel();
@@ -1003,22 +1198,6 @@ 

- -
-

XRTransientInputHitTestSource/cancel

-

In only one current engine.

-
- FirefoxNoneSafariNoneChrome81+ -
- OperaNoneEdge81+ -
- Edge (Legacy)NoneIENone -
- Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
-
-

The cancel() method, when invoked on XRTransientInputHitTestSource hitTestSource, signals that the application is no longer interested in obtaining hit test results for the specified hitTestSource.

When cancel() method is invoked, the user agent MUST cancel a hit test source for transient input by running the following steps:

@@ -1032,22 +1211,6 @@

XRTransientInputHitTestSource hitTestSource, the user agent MAY cancel a hit test source for transient input if hitTestSource is still active. The cancelation MAY happen at an unspecified time (or not at all) and the application SHOULD NOT rely on this behavior for cleanup.

5. Hit test result

5.1. XRHitTestResult

-
- -
-

XRHitTestResult

-

In only one current engine.

-
- FirefoxNoneSafariNoneChrome81+ -
- OperaNoneEdge81+ -
- Edge (Legacy)NoneIENone -
- Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
-
-
[SecureContext, Exposed=Window]
 interface XRHitTestResult {
   XRPose? getPose(XRSpace baseSpace);
@@ -1098,55 +1261,10 @@ 

<

5.2. XRTransientInputHitTestResult

-
- -
-

XRTransientInputHitTestResult

-

In only one current engine.

-
- FirefoxNoneSafariNoneChrome81+ -
- OperaNoneEdge81+ -
- Edge (Legacy)NoneIENone -
- Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
-
-
-
- -
-

XRTransientInputHitTestResult/inputSource

-

In only one current engine.

-
- FirefoxNoneSafariNoneChrome81+ -
- OperaNoneEdge81+ -
- Edge (Legacy)NoneIENone -
- Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
-
-
-

XRTransientInputHitTestResult/results

-

In only one current engine.

-
- FirefoxNoneSafariNoneChrome81+ -
- OperaNoneEdge81+ -
- Edge (Legacy)NoneIENone -
- Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
-
-
[SecureContext, Exposed=Window]
 interface XRTransientInputHitTestResult {
   [SameObject] readonly attribute XRInputSource inputSource;
-  readonly attribute FrozenArray<XRHitTestResult> results;
+  readonly attribute FrozenArray<XRHitTestResult> results;
 };
 

A XRTransientInputHitTestResult contains array of result of a hit test for transient input, grouped by XRInputSource inputSource.

@@ -1191,22 +1309,6 @@

The application is considered to make an unreasonable number of requests when the total number of active hit test sources or recently made requests is considered too high for a legitimate use of the API. This is an OPTIONAL privacy measure that the user agent MAY take to avoid abuse.

The application can request hit test using XRSession's requestHitTestSource() method.

-
- -
-

XRSession/requestHitTestSource

-

In only one current engine.

-
- FirefoxNoneSafariNoneChrome81+ -
- OperaNoneEdge81+ -
- Edge (Legacy)NoneIENone -
- Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet12.1+Opera MobileNone -
-
-

The requestHitTestSource(options) method, when invoked on an XRSession session, MUST run the following steps:

  1. @@ -1214,7 +1316,7 @@

    If hit-test feature descriptor is not contained in the session’s list of enabled features, reject promise with NotSupportedError and abort these steps.

  2. -

    If session’s ended value is true, throw an InvalidStateError and abort these steps.

    +

    If session’s ended value is true, throw an InvalidStateError and abort these steps.

  3. The user agent MAY reject promise with NotAllowedError and abort these steps if there is a unreasonable number of requests.

  4. @@ -1230,22 +1332,6 @@

-
- -
-

XRSession/requestHitTestSourceForTransientInput

-

In only one current engine.

-
- FirefoxNoneSafariNoneChrome81+ -
- OperaNoneEdge81+ -
- Edge (Legacy)NoneIENone -
- Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
-
-

The requestHitTestSourceForTransientInput(options) method, when invoked on an XRSession session, MUST run the following steps:

  1. @@ -1253,7 +1339,7 @@

    If hit-test feature descriptor is not contained in the session’s list of enabled features, reject promise with NotSupportedError and abort these steps.

  2. -

    If session’s ended value is true, throw an InvalidStateError and abort these steps.

    +

    If session’s ended value is true, throw an InvalidStateError and abort these steps.

  3. The user agent MAY reject promise with NotAllowedError and abort these steps if there is a unreasonable number of requests.

  4. @@ -1340,30 +1426,14 @@

    8. Obtaining hit test results

    partial interface XRFrame {
    -  FrozenArray<XRHitTestResult> getHitTestResults(XRHitTestSource hitTestSource);
    -  FrozenArray<XRTransientInputHitTestResult> getHitTestResultsForTransientInput(XRTransientInputHitTestSource hitTestSource);
    +  FrozenArray<XRHitTestResult> getHitTestResults(XRHitTestSource hitTestSource);
    +  FrozenArray<XRTransientInputHitTestResult> getHitTestResultsForTransientInput(XRTransientInputHitTestSource hitTestSource);
     };
     

    The XRFrame is extended to contain an associated map of hit test sources to hit test results that stores a mapping from XRHitTestSource to an array of XRHitTestResults.

    The XRFrame is extended to contain an associated map of hit test sources to hit test results for transient input that stores a mapping from XRTransientInputHitTestSource to an array of XRTransientInputHitTestResults.

    The application can obtain hit test results from an XRHitTestSource by using XRFrame's getHitTestResults() method.

    -
    - -
    -

    XRFrame/getHitTestResults

    -

    In only one current engine.

    -
    - FirefoxNoneSafariNoneChrome81+ -
    - OperaNoneEdge81+ -
    - Edge (Legacy)NoneIENone -
    - Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
    -
    -

    When the getHitTestResults(hitTestSource) method, when invoked on an XRFrame frame, the user agent MUST run the following steps:

    1. @@ -1378,22 +1448,6 @@

      The application can obtain hit test results for transient input from an XRTransientInputHitTestSource by using XRFrame's getHitTestResultsForTransientInput() method.

      -
      - -
      -

      XRFrame/getHitTestResultsForTransientInput

      -

      In only one current engine.

      -
      - FirefoxNoneSafariNoneChrome81+ -
      - OperaNoneEdge81+ -
      - Edge (Legacy)NoneIENone -
      - Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
      -
      -

      When the getHitTestResultsForTransientInput(hitTestSource) method, when invoked on an XRFrame frame, the user agent MUST run the following steps:

      1. @@ -1417,22 +1471,6 @@

        9.2. XRRay

        -
        - -
        -

        XRRay

        -

        In only one current engine.

        -
        - FirefoxNoneSafariNoneChrome81+ -
        - OperaNoneEdge81+ -
        - Edge (Legacy)NoneIENone -
        - Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
        -
        -

        An XRRay is a geometric ray described by an origin point and direction vector.

        An XRRay contains a matrix which is a matrix.

        [SecureContext, Exposed=Window]
        @@ -1445,22 +1483,6 @@ 

        -
        - -
        -

        XRRay/XRRay

        -

        In only one current engine.

        -
        - FirefoxNoneSafariNoneChrome81+ -
        - OperaNoneEdge81+ -
        - Edge (Legacy)NoneIENone -
        - Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
        -
        -

        The XRRay(origin, direction) constructor MUST perform the following steps when invoked:

        1. @@ -1508,58 +1530,10 @@

          - -
          -

          XRRay/origin

          -

          In only one current engine.

          -
          - FirefoxNoneSafariNoneChrome81+ -
          - OperaNoneEdge81+ -
          - Edge (Legacy)NoneIENone -
          - Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
          -
          -

      The origin attribute defines the 3-dimensional point in space that the ray originates from, given in meters. The origin's w attribute MUST be 1.0.

      -
      - -
      -

      XRRay/direction

      -

      In only one current engine.

      -
      - FirefoxNoneSafariNoneChrome81+ -
      - OperaNoneEdge81+ -
      - Edge (Legacy)NoneIENone -
      - Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
      -
      -

      The direction attribute defines the ray’s 3-dimensional directional vector. The direction's w attribute MUST be 0.0 and the vector MUST be normalized to have a length of 1.0.

      -
      - -
      -

      XRRay/matrix

      -

      In only one current engine.

      -
      - FirefoxNoneSafariNoneChrome81+ -
      - OperaNoneEdge81+ -
      - Edge (Legacy)NoneIENone -
      - Firefox for AndroidNoneiOS SafariNoneChrome for Android81+Android WebViewNoneSamsung Internet13.0+Opera MobileNone -
      -
      -

      The matrix attribute is a matrix which represents a transform that can be used to position objects along the XRRay. It is a transform from a ray originating at [0, 0, 0] and extending down the negative Z axis to the ray described by the XRRay's origin and direction. Such a matrix MUST be one that has a rotation component which leaves any vector perpendicular to direction and the Z axis unchanged. This attribute MUST be computed by obtaining the matrix for the XRRay. This attribute SHOULD be lazily evaluated.

      -

      Note: The XRRay's matrix can be used to easily position graphical representations of the ray when rendering.

      +

      Note: The XRRay's matrix can be used to easily position graphical representations of the ray when rendering.

      To obtain the matrix for a given XRRay ray

        @@ -1610,7 +1584,7 @@

        Returns a collection of 3D poses representing intersection points of the passed in ray with user’s environment. Each entry in the collection should also contain information about the type of the native entity that was used to obtain that native result and enough information to enable the user agent to compute surface normal to the user’s environment at the intersection point.

        -

        Note: For devices that do not expose the hit test functionality natively, it might still be possible for user agents to implement this specification by leveraging other ways of obtaining the information about user’s environment that might be exposed by the XR device.

        +

        Note: For devices that do not expose the hit test functionality natively, it might still be possible for user agents to implement this specification by leveraging other ways of obtaining the information about user’s environment that might be exposed by the XR device.

        10.2. Native entity type

        Native hit test results returned by XR device should contain information about the type of the entity used to compute the result. Such native types might consist of, but not be limited to: @@ -1677,7 +1651,7 @@

        [RFC2119]

        + except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

        Examples in this specification are introduced with the words “for example” or are set apart from the normative text with class="example", @@ -1690,21 +1664,23 @@

        , like this:

        -

        Note, this is an informative note.

        -

        Conformant Algorithms

        -

        Requirements phrased in the imperative as part of algorithms +

        Note, this is an informative note.

        +
        +

        Conformant Algorithms

        +

        Requirements phrased in the imperative as part of algorithms (such as "strip any leading space characters" or "return false and abort these steps") are to be interpreted with the meaning of the key word ("must", "should", "may", etc) used in introducing the algorithm.

        -

        Conformance requirements phrased as algorithms or specific steps +

        Conformance requirements phrased as algorithms or specific steps can be implemented in any manner, so long as the end result is equivalent. In particular, the algorithms defined in this specification are intended to be easy to understand and are not intended to be performant. Implementers are encouraged to optimize.

        +

      Index

      @@ -1848,440 +1824,92 @@

      y, in § 9.1
    2. z, in § 9.1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

      Terms defined by reference

      • [ECMASCRIPT] defines the following terms:
          -
        • IsDetachedBuffer +
        • IsDetachedBuffer
      • - [geometry-1] defines the following terms: + [GEOMETRY-1] defines the following terms:
          -
        • DOMPointInit -
        • DOMPointReadOnly -
        • w (for DOMPointReadOnly) -
        • x (for DOMPointReadOnly) -
        • y (for DOMPointReadOnly) -
        • z (for DOMPointReadOnly) +
        • DOMPointInit +
        • DOMPointReadOnly +
        • w (for DOMPointInit) +
        • w (for DOMPointReadOnly) +
        • x (for DOMPointInit) +
        • x (for DOMPointReadOnly) +
        • y (for DOMPointInit) +
        • y (for DOMPointReadOnly) +
        • z (for DOMPointInit) +
        • z (for DOMPointReadOnly)
      • [INFRA] defines the following terms:
          -
        • contain -
        • list +
        • contain +
        • list
      • [WEBIDL] defines the following terms:
          -
        • DOMString -
        • Exposed -
        • Float32Array -
        • FrozenArray -
        • InvalidStateError -
        • NotAllowedError -
        • NotSupportedError -
        • OperationError -
        • Promise -
        • SameObject -
        • SecureContext -
        • TypeError -
        • a new promise -
        • double -
        • reject -
        • resolve -
        • undefined +
        • DOMString +
        • Exposed +
        • Float32Array +
        • FrozenArray +
        • InvalidStateError +
        • NotAllowedError +
        • NotSupportedError +
        • OperationError +
        • Promise +
        • SameObject +
        • SecureContext +
        • TypeError +
        • a new promise +
        • double +
        • reject +
        • resolve +
        • sequence +
        • undefined
      • - [webxr] defines the following terms: + [WEBXR] defines the following terms:
          -
        • XRInputSource -
        • XRPose -
        • XRSpace -
        • profiles -
        • session -
        • targetRaySpace +
        • XRInputSource +
        • XRPose +
        • XRSpace +
        • profiles +
        • session +
        • targetRaySpace
      • - [webxr device api - level 1] defines the following terms: + [WEBXR DEVICE API - LEVEL 1] defines the following terms:
          -
        • XRFrame -
        • XRRigidTransform -
        • XRSession -
        • active -
        • capable of supporting -
        • effective origin -
        • ended -
        • feature descriptor -
        • feature policy -
        • identity transform -
        • inline xr device -
        • input profile name -
        • list of active xr input sources -
        • list of enabled features -
        • list of frame updates -
        • matrix (for XRRigidTransform) -
        • native origin -
        • normalize -
        • origin offset -
        • populate the pose -
        • session (for XRSpace) -
        • xr device (for XRSession) +
        • XRFrame +
        • XRRigidTransform +
        • XRSession +
        • active +
        • capable of supporting +
        • effective origin +
        • feature descriptor +
        • feature policy +
        • identity transform +
        • inline xr device +
        • input profile name +
        • list of active xr input sources +
        • list of enabled features +
        • list of frame updates +
        • matrix +
        • matrix (for XRRigidTransform) +
        • native origin +
        • normalize +
        • origin offset +
        • populate the pose +
        • session (for XRFrame) +
        • session (for XRSpace) +
        • xr device +
        • xr device (for XRSession)

      References

      @@ -2290,7 +1918,7 @@

      N
      [ECMASCRIPT]
      ECMAScript Language Specification. URL: https://tc39.es/ecma262/multipage/
      [GEOMETRY-1] -
      Simon Pieters; Chris Harrelson. Geometry Interfaces Module Level 1. 4 December 2018. CR. URL: https://www.w3.org/TR/geometry-1/ +
      Simon Pieters; Chris Harrelson. Geometry Interfaces Module Level 1. URL: https://drafts.fxtf.org/geometry/
      [INFRA]
      Anne van Kesteren; Domenic Denicola. Infra Standard. Living Standard. URL: https://infra.spec.whatwg.org/
      [RFC2119] @@ -2298,7 +1926,7 @@

      N
      [WEBIDL]
      Edgar Chen; Timothy Gu. Web IDL Standard. Living Standard. URL: https://webidl.spec.whatwg.org/
      [WEBXR] -
      Brandon Jones; Manish Goregaokar; Rik Cabanier. WebXR Device API. 31 March 2022. CR. URL: https://www.w3.org/TR/webxr/ +
      Brandon Jones; Manish Goregaokar; Rik Cabanier. WebXR Device API. URL: https://immersive-web.github.io/webxr/

      IDL Index

      enum XRHitTestTrackableType {
      @@ -2309,13 +1937,13 @@ 

      I dictionary XRHitTestOptionsInit { required XRSpace space; - FrozenArray<XRHitTestTrackableType> entityTypes; + sequence<XRHitTestTrackableType> entityTypes; XRRay offsetRay; }; dictionary XRTransientInputHitTestOptionsInit { required DOMString profile; - FrozenArray<XRHitTestTrackableType> entityTypes; + sequence<XRHitTestTrackableType> entityTypes; XRRay offsetRay; }; @@ -2371,660 +1999,1075 @@

      Decide if we need to specify other axes of the coordinate system defined by hit test result’s native origin to maintain compatibility between different implementations & differrent AR frameworks.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + \ No newline at end of file + function previousHighlightIndex(algoName, varName) { + return indexNames.get(algoName+"///"+varName); + } + function nameFromIndex(index) { + return "selected" + index; + } +} + \ No newline at end of file