Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1013)

Unified Diff: Source/modules/vr/VRPositionState.h

Issue 848053002: Adding WebVR interface to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed compiler warning treated as an error on Windows Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/vr/VRPositionState.h
diff --git a/Source/modules/vr/VRPositionState.h b/Source/modules/vr/VRPositionState.h
new file mode 100644
index 0000000000000000000000000000000000000000..91c4aa8007270faccf37d94a904312ce210c0abe
--- /dev/null
+++ b/Source/modules/vr/VRPositionState.h
@@ -0,0 +1,51 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef VRPositionState_h
+#define VRPositionState_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "core/dom/DOMPoint.h"
+#include "platform/heap/Handle.h"
+#include "public/platform/WebVR.h"
+#include "wtf/Forward.h"
+#include "wtf/text/WTFString.h"
+
+namespace blink {
+
+class VRPositionState final : public GarbageCollected<VRPositionState>, public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static VRPositionState* create()
+ {
+ return new VRPositionState();
+ }
+
+ double timeStamp() const { return m_timeStamp; }
+ DOMPoint* orientation() const { return m_orientation; }
+ DOMPoint* position() const { return m_position; }
+ DOMPoint* angularVelocity() const { return m_angularVelocity; }
+ DOMPoint* linearVelocity() const { return m_linearVelocity; }
+ DOMPoint* angularAcceleration() const { return m_angularAcceleration; }
+ DOMPoint* linearAcceleration() const { return m_linearAcceleration; }
+
+ void setState(const blink::WebHMDSensorState&);
+
+ virtual void trace(Visitor*);
+
+private:
+ VRPositionState();
+
+ double m_timeStamp;
+ Member<DOMPoint> m_orientation;
+ Member<DOMPoint> m_position;
+ Member<DOMPoint> m_angularVelocity;
+ Member<DOMPoint> m_linearVelocity;
+ Member<DOMPoint> m_angularAcceleration;
+ Member<DOMPoint> m_linearAcceleration;
+};
+
+} // namespace blink
+
+#endif // VRPositionState_h

Powered by Google App Engine
This is Rietveld 408576698