tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

XRSpace.h (1718B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef mozilla_dom_XRSpace_h_
      8 #define mozilla_dom_XRSpace_h_
      9 
     10 #include "XRNativeOrigin.h"
     11 #include "gfxVR.h"
     12 #include "mozilla/DOMEventTargetHelper.h"
     13 #include "mozilla/dom/WebXRBinding.h"
     14 
     15 namespace mozilla::dom {
     16 
     17 class XRRigidTransform;
     18 class XRSession;
     19 
     20 class XRSpace : public DOMEventTargetHelper {
     21 public:
     22  NS_DECL_ISUPPORTS_INHERITED
     23  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XRSpace, DOMEventTargetHelper)
     24 
     25  explicit XRSpace(nsIGlobalObject* aParent, XRSession* aSession,
     26                   XRNativeOrigin* aNativeOrigin);
     27 
     28  // WebIDL Boilerplate
     29  JSObject* WrapObject(JSContext* aCx,
     30                       JS::Handle<JSObject*> aGivenProto) override;
     31 
     32  XRSession* GetSession() const;
     33  XRNativeOrigin* GetNativeOrigin() const;
     34 
     35  // Non webIDL Members
     36  gfx::QuaternionDouble GetEffectiveOriginOrientation() const;
     37  gfx::PointDouble3D GetEffectiveOriginPosition() const;
     38  gfx::Matrix4x4Double GetEffectiveOriginTransform() const;
     39  virtual bool IsPositionEmulated() const;
     40 
     41 protected:
     42  virtual ~XRSpace() = default;
     43 
     44  RefPtr<XRSession> mSession;
     45  RefPtr<XRNativeOrigin> mNativeOrigin;
     46 
     47  // https://immersive-web.github.io/webxr/#xrspace-origin-offset
     48  // Origin Offset, represented as a rigid transform
     49  gfx::PointDouble3D mOriginOffsetPosition;
     50  gfx::QuaternionDouble mOriginOffsetOrientation;
     51 };
     52 
     53 }  // namespace mozilla::dom
     54 
     55 #endif  // mozilla_dom_XRSpace_h_