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 #ifndef mozilla_dom_XRReferenceSpace_h_
8 #define mozilla_dom_XRReferenceSpace_h_
10 #include "mozilla/DOMEventTargetHelper.h"
11 #include "mozilla/dom/WebXRBinding.h"
12 #include "mozilla/dom/XRSpace.h"
16 namespace mozilla::dom
{
18 enum class XRReferenceSpaceType
: uint8_t;
19 class XRRigidTransform
;
22 class XRReferenceSpace
: public XRSpace
{
24 explicit XRReferenceSpace(nsIGlobalObject
* aParent
, XRSession
* aSession
,
25 XRNativeOrigin
* aNativeOrigin
,
26 XRReferenceSpaceType aType
);
29 JSObject
* WrapObject(JSContext
* aCx
,
30 JS::Handle
<JSObject
*> aGivenProto
) override
;
33 virtual already_AddRefed
<XRReferenceSpace
> GetOffsetReferenceSpace(
34 const XRRigidTransform
& aOriginOffset
);
36 // TODO (Bug 1611309): Implement XRReferenceSpace reset events
37 // https://immersive-web.github.io/webxr/#eventdef-xrreferencespace-reset
38 IMPL_EVENT_HANDLER(reset
);
41 virtual ~XRReferenceSpace() = default;
42 XRReferenceSpaceType mType
;
45 } // namespace mozilla::dom
47 #endif // mozilla_dom_XRReferenceSpace_h_