mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Merge webxr repository (#35228)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
64b40ea700
commit
534e78db53
30 changed files with 7303 additions and 2 deletions
28
components/shared/webxr/space.rs
Normal file
28
components/shared/webxr/space.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
use crate::InputId;
|
||||
use crate::Joint;
|
||||
use euclid::RigidTransform3D;
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[cfg_attr(feature = "ipc", derive(serde::Serialize, serde::Deserialize))]
|
||||
/// A stand-in type for "the space isn't statically known since
|
||||
/// it comes from client side code"
|
||||
pub struct ApiSpace;
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "ipc", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub enum BaseSpace {
|
||||
Local,
|
||||
Floor,
|
||||
Viewer,
|
||||
BoundedFloor,
|
||||
TargetRay(InputId),
|
||||
Grip(InputId),
|
||||
Joint(InputId, Joint),
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[cfg_attr(feature = "ipc", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct Space {
|
||||
pub base: BaseSpace,
|
||||
pub offset: RigidTransform3D<f32, ApiSpace, ApiSpace>,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue