Expand description
This crate defines the Rust API for WebXR. It is implemented by the webxr
crate.
ModulesΒ§
- device π
- Traits to be implemented by backends
- error π
- events π
- frame π
- hand π
- hittest π
- input π
- layer π
- mock π
- registry π
- session π
- space π
- util
- view π
- This crate uses
euclid
βs typed units, and exposes different coordinate spaces.
StructsΒ§
- ApiSpace
- A stand-in type for βthe space isnβt statically known since it comes from client side codeβ
- Context
Id - Entity
Types - Vec
, but better - Finger
- Frame
- The per-frame data that is provided by the device. https://www.w3.org/TR/webxr/#xrframe
- Hand
- Hand
Space - HitTest
Id - HitTest
Result - HitTest
Source - https://immersive-web.github.io/hit-test/#dictdef-xrhittestoptionsinit
- HitTest
Space - The coordinate space of a hit test result
- Input
Frame - InputId
- Input
Source - Joint
Frame - Layer
Grand Manager - LayerId
- Layer
Manager - Layer
Manager Factory - Main
Thread Registry - Mock
Button - Mock
Device Init - Mock
Input Init - Mock
Region - Mock
View Init - Mock
World - Quitter
- Ray
- https://immersive-web.github.io/hit-test/#xrray
- Registry
- Session
- An object that represents an XR session. This is owned by the content thread. https://www.w3.org/TR/webxr/#xrsession-interface
- Session
Builder - A type for building XR sessions
- Session
Id - Session
Init - https://immersive-web.github.io/webxr/#dictdef-xrsessioninit
- Session
Thread - For devices that want to do their own thread management, the
SessionThread
type is exposed. - SomeEye
- Pattern-match on eyes
- Space
- SubImage
- https://immersive-web.github.io/layers/#xrsubimagetype
- SubImages
- Triangle
- View
- For each eye, the pose of that eye,
its projection onto its display.
For stereo displays, we have a
View<LeftEye>
and aView<RightEye>
. For mono displays, we hagve aView<Viewer>
https://immersive-web.github.io/webxr/#xrview - Viewer
Pose - Viewports
- A list of viewports per-eye in the order of fields in Views.
- WebXr
Receiver - Receiving end of a channel using serialized messages.
- WebXr
Sender - Sending end of a channel using serialized messages.
EnumsΒ§
- Base
Space - Capture
- The coordinate space of a secondary capture view
- Cube
Back - The coordinate space of the back frustrum of a cubemap
- Cube
Bottom - The coordinate space of the bottom frustrum of a cubemap
- Cube
Left - The coordinate space of the left frustrum of a cubemap
- Cube
Right - The coordinate space of the right frustrum of a cubemap
- CubeTop
- The coordinate space of the top frustrum of a cubemap
- Display
- The normalized device coordinate space, where the display is from (-1,-1) to (1,1).
- Entity
Type - https://immersive-web.github.io/hit-test/#enumdef-xrhittesttrackabletype
- Environment
Blend Mode - https://immersive-web.github.io/webxr-ar-module/#xrenvironmentblendmode-enum
- Error
- Errors that can be produced by XR.
- Event
- Event
Buffer - Convenience structure for buffering up events when no event callback has been set
- Finger
Joint - Floor
- The coordinate space of the floor https://immersive-web.github.io/webxr/#dom-xrreferencespacetype-local-floor
- Frame
Update Event - Handedness
- Input
- The coordinate space of an input device
- Joint
- Layer
Init - Layer
Layout - https://immersive-web.github.io/layers/#enumdef-xrlayerlayout
- LeftEye
- The coordinate space of the left eye https://immersive-web.github.io/webxr/#dom-xreye-left
- Mock
Button Type - Mock
Device Msg - Mock
Input Msg - Mock
Views Init - Native
- The native 3D coordinate space of the device This is not part of the webvr specification.
- Right
Eye - The coordinate space of the right eye https://immersive-web.github.io/webxr/#dom-xreye-right
- Select
Event - Select
Kind - Session
Mode - https://www.w3.org/TR/webxr/#xrsessionmode-enum
- Target
RayMode - Viewer
- The coordinate space of the viewer https://immersive-web.github.io/webxr/#dom-xrreferencespacetype-viewer
- Viewport
- The unnormalized device coordinate space, where the display is from (0,0) to (w,h), measured in pixels.
- Views
- Whether a device is mono or stereo, and the views it supports.
- Visibility
ConstantsΒ§
TraitsΒ§
- DeviceAPI
- A trait for using an XR device
- DiscoveryAPI
- A trait for discovering XR devices
- GLContexts
- GLTypes
- Layer
Grand ManagerAPI - Layer
ManagerAPI - Main
Thread Session - Devices that need to can run sessions on the main thread.
- Mock
DiscoveryAPI - A trait for discovering mock XR devices
FunctionsΒ§
- recv_
timeout - webxr_
channel - Create a connected IpcSender and IpcReceiver that
transfer messages of a given type provided by type
T
or inferred by the types of messages sent by the sender.