Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

created event.md #10

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions source/docs/events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# <events>

## mr.js Events

### `enterXR`

Triggered when the XR session is initialized. this is useful for when dealing with XR exclusive features, such as hit testing, accessing the scene mesh or planes.

origin: `mr-app`

### `exitXR`

Triggered when the session is ended. Useful for when you'd like to save XR state, or when app-specific content needs to be reconfigured for a 2D window.

origin: `mr-app`

### `new-entity`

Triggered whenever an entity is created.

origin: the created element

## Interaction Events

### `selectstart`

Triggered via the controller trigger is pressed a pinch gesture is performed.

origin: `document`

detail:

- `handedness`: `left` or `right`
- `position`: a THREE.js Vector3 of the pinch/controller position


Check failure on line 36 in source/docs/events.md

View workflow job for this annotation

GitHub Actions / markdownlint

Multiple consecutive blank lines [Expected: 1; Actual: 2]
### `selectmoved`

Triggered when the controller trigger or pinch is held.

origin: `document`

detail:

- `handedness`: `left` or `right`
- `position`: a THREE.js Vector3 of the pinch/controller position

### `selectend`

Triggered when the controller trigger or pinch is released.

origin: `document`

detail:

- `handedness`: `left` or `right`
- `position`: a THREE.js Vector3 of the pinch/controller position

### `hover-start`

Triggered when the cursor or the users finger begins hovering over an entity.

the `hover` CSS class is added to the entity when this event is triggered

origin: the target element

detail:

- `worldPosition`: a THREE.js Vector3 of the hover world position
- `position`: a THREE.js Vector3 of the local hover position


Check failure on line 72 in source/docs/events.md

View workflow job for this annotation

GitHub Actions / markdownlint

Multiple consecutive blank lines [Expected: 1; Actual: 2]
### `hover-end`

Triggered when the cursor or the users finger stops hovering over an entity

the `hover` CSS class is removed to the entity when this event is triggered

origin: the target element

### `touch-start`

Triggered whened the controller trigger is pulled, a pinch gesture occurs, or the user touches an entity.

origin: the target element

detail:

- `worldPosition`: a THREE.js Vector3 of the hover world position
- `position`: a THREE.js Vector3 of the local hover position

### `touch`

origin: the target element

detail:

- `worldPosition`: a THREE.js Vector3 of the hover world position
- `position`: a THREE.js Vector3 of the local hover position
- `delta`: a THREE.js Vector3 of the delta between the the current local position and the last


Check failure on line 102 in source/docs/events.md

View workflow job for this annotation

GitHub Actions / markdownlint

Multiple consecutive blank lines [Expected: 1; Actual: 2]
### `touch-end`

Triggered whened the controller trigger or pinch is released, or the user stops touching an entity.

origin: the target element
Loading