mirror of
https://github.com/servo/servo.git
synced 2025-08-14 18:05:36 +01:00
Auto merge of #23055 - Manishearth:xrspace, r=asajeffrey
Some XRSpace improvements Proper XRSpace support is blocked on https://github.com/immersive-web/webxr/issues/565 , but in the meantime this improves XRSpace support a little bit, preparing both for support in getViewerPose and getPose as well as handling input spaces eventually. r? @jdm <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23055) <!-- Reviewable:end -->
This commit is contained in:
commit
e58226814f
12 changed files with 206 additions and 53 deletions
|
@ -8,6 +8,6 @@
|
|||
interface XRFrame {
|
||||
readonly attribute XRSession session;
|
||||
|
||||
XRViewerPose? getViewerPose(optional XRReferenceSpace referenceSpace);
|
||||
XRViewerPose? getViewerPose(XRReferenceSpace referenceSpace);
|
||||
// XRInputPose? getInputPose(XRInputSource inputSource, optional XRReferenceSpace referenceSpace);
|
||||
};
|
||||
|
|
|
@ -4,18 +4,8 @@
|
|||
|
||||
// https://immersive-web.github.io/webxr/#xrreferencespace-interface
|
||||
|
||||
enum XRReferenceSpaceType {
|
||||
"stationary",
|
||||
"bounded",
|
||||
"unbounded"
|
||||
};
|
||||
|
||||
dictionary XRReferenceSpaceOptions {
|
||||
required XRReferenceSpaceType type;
|
||||
};
|
||||
|
||||
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
|
||||
interface XRReferenceSpace : XRSpace {
|
||||
// attribute XRRigidTransform originOffset;
|
||||
attribute XRRigidTransform originOffset;
|
||||
// attribute EventHandler onreset;
|
||||
};
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
// https://immersive-web.github.io/webxr/#xrrigidtransform-interface
|
||||
|
||||
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
|
||||
// [Constructor(optional DOMPointInit position, optional DOMPointInit orientation)]
|
||||
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled",
|
||||
Constructor(optional DOMPointInit position, optional DOMPointInit orientation)]
|
||||
interface XRRigidTransform {
|
||||
// readonly attribute DOMPointReadOnly position;
|
||||
// readonly attribute DOMPointReadOnly orientation;
|
||||
readonly attribute DOMPointReadOnly position;
|
||||
readonly attribute DOMPointReadOnly orientation;
|
||||
// readonly attribute Float32Array matrix;
|
||||
};
|
||||
|
|
|
@ -24,8 +24,7 @@ interface XRSession : EventTarget {
|
|||
attribute XRLayer? baseLayer;
|
||||
|
||||
// // Methods
|
||||
// Promise<XRReferenceSpace> requestReferenceSpace(XRReferenceSpaceType type,
|
||||
// optional XRReferenceSpaceOptions options);
|
||||
Promise<XRReferenceSpace> requestReferenceSpace(XRReferenceSpaceOptions options);
|
||||
|
||||
// FrozenArray<XRInputSource> getInputSources();
|
||||
|
||||
|
@ -43,3 +42,15 @@ interface XRSession : EventTarget {
|
|||
// attribute EventHandler onselectstart;
|
||||
// attribute EventHandler onselectend;
|
||||
};
|
||||
|
||||
enum XRReferenceSpaceType {
|
||||
"identity",
|
||||
"stationary",
|
||||
"bounded",
|
||||
"unbounded"
|
||||
};
|
||||
|
||||
dictionary XRReferenceSpaceOptions {
|
||||
required XRReferenceSpaceType type;
|
||||
XRStationaryReferenceSpaceSubtype subtype;
|
||||
};
|
||||
|
|
|
@ -10,10 +10,6 @@ enum XRStationaryReferenceSpaceSubtype {
|
|||
"position-disabled"
|
||||
};
|
||||
|
||||
dictionary XRStationaryReferenceSpaceOptions : XRReferenceSpaceOptions {
|
||||
required XRStationaryReferenceSpaceSubtype subtype;
|
||||
};
|
||||
|
||||
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
|
||||
interface XRStationaryReferenceSpace: XRReferenceSpace {
|
||||
// readonly attribute XRStationaryReferenceSpaceSubtype subtype;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue