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