XRPose.h (1399B)
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_XRPose_h_ 8 #define mozilla_dom_XRPose_h_ 9 10 #include "gfxVR.h" 11 #include "mozilla/DOMEventTargetHelper.h" 12 #include "mozilla/dom/WebXRBinding.h" 13 #include "mozilla/dom/XRRigidTransform.h" 14 15 namespace mozilla::dom { 16 17 class XRRigidTransform; 18 class XRView; 19 20 class XRPose : public nsISupports, public nsWrapperCache { 21 public: 22 NS_DECL_CYCLE_COLLECTING_ISUPPORTS 23 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(XRPose) 24 25 explicit XRPose(nsISupports* aParent, XRRigidTransform* aTransform, 26 bool aEmulatedPosition); 27 void SetEmulatedPosition(bool aEmulated); 28 29 // WebIDL Boilerplate 30 nsISupports* GetParentObject() const { return mParent; } 31 JSObject* WrapObject(JSContext* aCx, 32 JS::Handle<JSObject*> aGivenProto) override; 33 34 // WebIDL Members 35 XRRigidTransform* Transform(); 36 bool EmulatedPosition() const; 37 38 protected: 39 virtual ~XRPose() = default; 40 nsCOMPtr<nsISupports> mParent; 41 RefPtr<XRRigidTransform> mTransform; 42 bool mEmulatedPosition; 43 }; 44 45 } // namespace mozilla::dom 46 47 #endif // mozilla_dom_XRPose_h_