mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #23164 - Manishearth:getpose, r=asajeffrey
Add XRFrame.getPose() I think I've figured out the model of poses, waiting on Nell for confirmation. Basically, `getViewerPose(p)` is equivalent to `getPose(source=viewerSpace, relative_to=p)` The eye-level space, for example, is stationary and stuck to the origin. The position-disabled and identity spaces somewhat counterintuitively follow you around (and appear to be stationary from `getViewerPose()` but not `getPose()`. The incorrect mental model kinda "works" when looking at only `getViewerPose()`, but we need to figure it out for `getPose()`. Todo (may add to this PR, but probably not) - implement `XRSession.viewerSpace` - implement position-disabled - implement floor-level (hard to test without a 6dof device) r? @asajeffrey <!-- 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/23164) <!-- Reviewable:end -->
This commit is contained in:
commit
967efc7fbc
7 changed files with 127 additions and 41 deletions
|
@ -8,6 +8,7 @@
|
|||
interface XRFrame {
|
||||
readonly attribute XRSession session;
|
||||
|
||||
XRViewerPose? getViewerPose(XRReferenceSpace referenceSpace);
|
||||
[Throws] XRViewerPose? getViewerPose(XRReferenceSpace referenceSpace);
|
||||
[Throws] XRPose? getPose(XRSpace space, XRSpace relativeTo);
|
||||
// XRInputPose? getInputPose(XRInputSource inputSource, optional XRReferenceSpace referenceSpace);
|
||||
};
|
||||
|
|
|
@ -20,6 +20,7 @@ interface XRSession : EventTarget {
|
|||
readonly attribute XREnvironmentBlendMode environmentBlendMode;
|
||||
|
||||
readonly attribute XRRenderState renderState;
|
||||
readonly attribute XRSpace viewerSpace;
|
||||
|
||||
// // Methods
|
||||
Promise<XRReferenceSpace> requestReferenceSpace(XRReferenceSpaceOptions options);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue