XRPose.cpp (1347B)
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 #include "mozilla/dom/XRPose.h" 8 9 #include "mozilla/dom/XRRigidTransform.h" 10 11 namespace mozilla::dom { 12 13 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(XRPose, mParent, mTransform) 14 NS_IMPL_CYCLE_COLLECTING_ADDREF(XRPose) 15 NS_IMPL_CYCLE_COLLECTING_RELEASE(XRPose) 16 17 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(XRPose) 18 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY 19 NS_INTERFACE_MAP_ENTRY(nsISupports) 20 NS_INTERFACE_MAP_END 21 22 XRPose::XRPose(nsISupports* aParent, XRRigidTransform* aTransform, 23 bool aEmulatedPosition) 24 : mParent(aParent), 25 mTransform(aTransform), 26 mEmulatedPosition(aEmulatedPosition) {} 27 28 JSObject* XRPose::WrapObject(JSContext* aCx, 29 JS::Handle<JSObject*> aGivenProto) { 30 return XRPose_Binding::Wrap(aCx, this, aGivenProto); 31 } 32 33 void XRPose::SetEmulatedPosition(bool aEmulated) { 34 mEmulatedPosition = aEmulated; 35 } 36 37 XRRigidTransform* XRPose::Transform() { return mTransform; } 38 39 bool XRPose::EmulatedPosition() const { return mEmulatedPosition; } 40 41 } // namespace mozilla::dom