OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GamepadPose_h | 5 #ifndef GamepadPose_h |
6 #define GamepadPose_h | 6 #define GamepadPose_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/dom/DOMTypedArray.h" | 9 #include "core/dom/DOMTypedArray.h" |
| 10 #include "device/gamepad/public/cpp/gamepad.h" |
10 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
11 #include "platform/wtf/Forward.h" | 12 #include "platform/wtf/Forward.h" |
12 #include "public/platform/WebGamepad.h" | |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class GamepadPose final : public GarbageCollected<GamepadPose>, | 16 class GamepadPose final : public GarbageCollected<GamepadPose>, |
17 public ScriptWrappable { | 17 public ScriptWrappable { |
18 DEFINE_WRAPPERTYPEINFO(); | 18 DEFINE_WRAPPERTYPEINFO(); |
19 | 19 |
20 public: | 20 public: |
21 static GamepadPose* Create() { return new GamepadPose(); } | 21 static GamepadPose* Create() { return new GamepadPose(); } |
22 | 22 |
23 bool hasOrientation() const { return has_orientation_; } | 23 bool hasOrientation() const { return has_orientation_; } |
24 bool hasPosition() const { return has_position_; } | 24 bool hasPosition() const { return has_position_; } |
25 | 25 |
26 DOMFloat32Array* orientation() const { return orientation_; } | 26 DOMFloat32Array* orientation() const { return orientation_; } |
27 DOMFloat32Array* position() const { return position_; } | 27 DOMFloat32Array* position() const { return position_; } |
28 DOMFloat32Array* angularVelocity() const { return angular_velocity_; } | 28 DOMFloat32Array* angularVelocity() const { return angular_velocity_; } |
29 DOMFloat32Array* linearVelocity() const { return linear_velocity_; } | 29 DOMFloat32Array* linearVelocity() const { return linear_velocity_; } |
30 DOMFloat32Array* angularAcceleration() const { return angular_acceleration_; } | 30 DOMFloat32Array* angularAcceleration() const { return angular_acceleration_; } |
31 DOMFloat32Array* linearAcceleration() const { return linear_acceleration_; } | 31 DOMFloat32Array* linearAcceleration() const { return linear_acceleration_; } |
32 | 32 |
33 void SetPose(const WebGamepadPose& state); | 33 void SetPose(const device::GamepadPose& state); |
34 | 34 |
35 DECLARE_VIRTUAL_TRACE(); | 35 DECLARE_VIRTUAL_TRACE(); |
36 | 36 |
37 private: | 37 private: |
38 GamepadPose(); | 38 GamepadPose(); |
39 | 39 |
40 bool has_orientation_; | 40 bool has_orientation_; |
41 bool has_position_; | 41 bool has_position_; |
42 | 42 |
43 Member<DOMFloat32Array> orientation_; | 43 Member<DOMFloat32Array> orientation_; |
44 Member<DOMFloat32Array> position_; | 44 Member<DOMFloat32Array> position_; |
45 Member<DOMFloat32Array> angular_velocity_; | 45 Member<DOMFloat32Array> angular_velocity_; |
46 Member<DOMFloat32Array> linear_velocity_; | 46 Member<DOMFloat32Array> linear_velocity_; |
47 Member<DOMFloat32Array> angular_acceleration_; | 47 Member<DOMFloat32Array> angular_acceleration_; |
48 Member<DOMFloat32Array> linear_acceleration_; | 48 Member<DOMFloat32Array> linear_acceleration_; |
49 }; | 49 }; |
50 | 50 |
51 } // namespace blink | 51 } // namespace blink |
52 | 52 |
53 #endif // VRPose_h | 53 #endif // VRPose_h |
OLD | NEW |