Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Joe Medley <[email protected]>
  • Loading branch information
Elchi3 and jpmedley authored Aug 18, 2021
1 parent 6ec98b1 commit 3741c76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions files/en-us/web/api/xrsession/requesthittestsource/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ browser-compat: api.XRSession.requestHitTestSource
{{APIRef("WebXR Device API")}}

The **`requestHitTestSource()`** method of the
{{domxref("XRSession")}} interface returns a {{jsxref("Promise")}} that resolves with an {{domxref("XRHitTestSource")}} object that can be used to obtain hit test results using the {{domxref("XRFrame.getHitTestResults()")}} method.
{{domxref("XRSession")}} interface returns a {{jsxref("Promise")}} that resolves with an {{domxref("XRHitTestSource")}} object that can be passed to {{domxref("XRFrame.getHitTestResults()")}}.

## Syntax

Expand All @@ -32,7 +32,7 @@ requestHitTestSource(options);
- `options`
- : An object containing configuration options, specifically:
- `space`: The {{domxref("XRSpace")}} that will be tracked by the hit test source.
- `entityTypes`: {{optional_inline}} An {{jsxref("Array")}} specifying the types of entities that should be used for the purposes of hit test source creation. If no no entity type is specified, the array defaults to a single element with the `plane` type. Possible types:
- `entityTypes`: {{optional_inline}} An {{jsxref("Array")}} specifying the types of entities to be used for hit test source creation. If no no entity type is specified, the array defaults to a single element with the `plane` type. Possible types:
- `point`: Compute hit test results based on characteristic points detected.
- `plane`: Compute hit test results based on real-world planes detected.
- `mesh`: Compute hit test results based on meshes detected.
Expand All @@ -52,13 +52,13 @@ returned promise with a {{domxref("DOMException")}}, specifically, one of the fo
- `InvalidStateError`
- : If the session has already ended.
- `NotAllowedError`
- : If there is an unreasonable amount of requests (some user agents might limit usage due to privacy reasons).
- : If there is an unreasonable amount of requests. Some user agents might limit usage for privacy reasons.

## Examples

### Requesting a hit test source

To request a hit test source, make sure to start an {{domxref("XRSession")}} with the `hit-test` session feature enabled. Then you can configure the hit test source and store it for later use in the frame loop where you can use the {{domxref("XRFrame.getHitTestResults()")}} method to obtain the hit test result.
To request a hit test source, start an {{domxref("XRSession")}} with the `hit-test` session feature enabled. Next, configure the hit test source and store it for later use in the frame loop and call {{domxref("XRFrame.getHitTestResults()")}} to obtain the result.

```js

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ browser-compat: api.XRSession.requestHitTestSourceForTransientInput
{{APIRef("WebXR Device API")}}

The **`requestHitTestSourceForTransientInput()`** method of the
{{domxref("XRSession")}} interface returns a {{jsxref("Promise")}} that resolves with an {{domxref("XRTransientInputHitTestSource")}} object that can be used to obtain hit test results using the {{domxref("XRFrame.getHitTestResultsForTransientInput()")}} method.
{{domxref("XRSession")}} interface returns a {{jsxref("Promise")}} that resolves with an {{domxref("XRTransientInputHitTestSource")}} object that can be passed to {{domxref("XRFrame.getHitTestResultsForTransientInput()")}}.

## Syntax

Expand All @@ -32,7 +32,7 @@ requestHitTestSourceForTransientInput(options);
- `options`
- : An object containing configuration options, specifically:
- `profile`: A string specifying the [input profile name](/en-US/docs/Web/API/XRInputSource) of the transient input source that will be used to compute hit test results.
- `entityTypes`: {{optional_inline}} An {{jsxref("Array")}} specifying the types of entities that should be used for the purposes of hit test source creation. If no no entity type is specified, the array defaults to a single element with the `plane` type. Possible types:
- `entityTypes`: {{optional_inline}} An {{jsxref("Array")}} specifying the types of entities to be used for hit test source creation. If no no entity type is specified, the array defaults to a single element with the `plane` type. Possible types:
- `point`: Compute hit test results based on characteristic points detected.
- `plane`: Compute hit test results based on real-world planes detected.
- `mesh`: Compute hit test results based on meshes detected.
Expand All @@ -52,13 +52,13 @@ returned promise with a {{domxref("DOMException")}}, specifically, one of the fo
- `InvalidStateError`
- : If the session has already ended.
- `NotAllowedError`
- : If there is an unreasonable amount of requests (some user agents might limit usage due to privacy reasons).
- : If there is an unreasonable amount of requests. Some user agents might limit usage for privacy reasons.

## Examples

### Requesting a transient hit test source

To request a hit test source, make sure to start an {{domxref("XRSession")}} with the `hit-test` session feature enabled. Then you can configure the hit test source and store it for later use in the frame loop where you can use the {{domxref("XRFrame.getHitTestResultsForTransientInput()")}} method to obtain the hit test result.
To request a hit test source, start an {{domxref("XRSession")}} with the `hit-test` session feature enabled. Next, configure the hit test source and store it for later use in the frame loop and call {{domxref("XRFrame.getHitTestResultsForTransientInput()")}} to obtain the result.

```js

Expand Down

0 comments on commit 3741c76

Please sign in to comment.