Update to treat view transforms as native-relative

This commit is contained in:
Manish Goregaokar 2020-05-16 21:49:44 -07:00
parent a97dcd9ad6
commit d627476893
6 changed files with 74 additions and 85 deletions

View file

@ -791,11 +791,14 @@ impl XRSessionMethods for XRSession {
// The pose of an object in native-space. Should never be exposed.
pub type ApiPose = RigidTransform3D<f32, ApiSpace, webxr_api::Native>;
// The pose of the viewer in some api-space.
pub type ApiViewerPose = RigidTransform3D<f32, webxr_api::Viewer, ApiSpace>;
// A transform between objects in some API-space
pub type ApiRigidTransform = RigidTransform3D<f32, ApiSpace, ApiSpace>;
#[derive(Clone, Copy)]
pub struct BaseSpace;
pub type BaseTransform = RigidTransform3D<f32, webxr_api::Native, BaseSpace>;
#[allow(unsafe_code)]
pub fn cast_transform<T, U, V, W>(
transform: RigidTransform3D<f32, T, U>,