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

Side by Side Diff: third_party/WebKit/Source/modules/gamepad/GamepadPose.h

Issue 2300543003: Added Pose attribute to Gamepad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gamepad_touched
Patch Set: Rebase Created 4 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef GamepadPose_h
6 #define GamepadPose_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/dom/DOMTypedArray.h"
10 #include "platform/heap/Handle.h"
11 #include "public/platform/WebGamepad.h"
12 #include "wtf/Forward.h"
13
14 namespace blink {
15
16 class GamepadPose final : public GarbageCollected<GamepadPose>, public ScriptWra ppable {
17 DEFINE_WRAPPERTYPEINFO();
18 public:
19 static GamepadPose* create()
20 {
21 return new GamepadPose();
22 }
23
24 bool hasOrientation() const { return m_hasOrientation; }
25 bool hasPosition() const { return m_hasPosition; }
26
27 DOMFloat32Array* orientation() const { return m_orientation; }
28 DOMFloat32Array* position() const { return m_position; }
29 DOMFloat32Array* angularVelocity() const { return m_angularVelocity; }
30 DOMFloat32Array* linearVelocity() const { return m_linearVelocity; }
31 DOMFloat32Array* angularAcceleration() const { return m_angularAcceleration; }
32 DOMFloat32Array* linearAcceleration() const { return m_linearAcceleration; }
33
34 void setPose(const WebGamepadPose &state);
35
36 DECLARE_VIRTUAL_TRACE();
37
38 private:
39 GamepadPose();
40
41 bool m_hasOrientation;
42 bool m_hasPosition;
43
44 Member<DOMFloat32Array> m_orientation;
45 Member<DOMFloat32Array> m_position;
46 Member<DOMFloat32Array> m_angularVelocity;
47 Member<DOMFloat32Array> m_linearVelocity;
48 Member<DOMFloat32Array> m_angularAcceleration;
49 Member<DOMFloat32Array> m_linearAcceleration;
50 };
51
52 } // namespace blink
53
54 #endif // VRPose_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/gamepad/Gamepad.idl ('k') | third_party/WebKit/Source/modules/gamepad/GamepadPose.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698