| OLD | NEW |
| 1 // Copyright 2015 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 VRPose_h | 5 #ifndef GamepadPose_h |
| 6 #define VRPose_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/DOMHighResTimeStamp.h" | |
| 10 #include "core/dom/DOMTypedArray.h" | 9 #include "core/dom/DOMTypedArray.h" |
| 11 #include "device/vr/vr_service.mojom-blink.h" | |
| 12 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 11 #include "public/platform/WebGamepad.h" |
| 13 #include "wtf/Forward.h" | 12 #include "wtf/Forward.h" |
| 14 | 13 |
| 15 namespace blink { | 14 namespace blink { |
| 16 | 15 |
| 17 class VRPose final : public GarbageCollected<VRPose>, public ScriptWrappable { | 16 class GamepadPose final : public GarbageCollected<GamepadPose>, public ScriptWra
ppable { |
| 18 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
| 19 public: | 18 public: |
| 20 static VRPose* create() | 19 static GamepadPose* create() |
| 21 { | 20 { |
| 22 return new VRPose(); | 21 return new GamepadPose(); |
| 23 } | 22 } |
| 24 | 23 |
| 25 DOMHighResTimeStamp timestamp() const { return m_timestamp; } | 24 bool hasOrientation() const { return m_hasOrientation; } |
| 25 bool hasPosition() const { return m_hasPosition; } |
| 26 |
| 26 DOMFloat32Array* orientation() const { return m_orientation; } | 27 DOMFloat32Array* orientation() const { return m_orientation; } |
| 27 DOMFloat32Array* position() const { return m_position; } | 28 DOMFloat32Array* position() const { return m_position; } |
| 28 DOMFloat32Array* angularVelocity() const { return m_angularVelocity; } | 29 DOMFloat32Array* angularVelocity() const { return m_angularVelocity; } |
| 29 DOMFloat32Array* linearVelocity() const { return m_linearVelocity; } | 30 DOMFloat32Array* linearVelocity() const { return m_linearVelocity; } |
| 30 DOMFloat32Array* angularAcceleration() const { return m_angularAcceleration;
} | 31 DOMFloat32Array* angularAcceleration() const { return m_angularAcceleration;
} |
| 31 DOMFloat32Array* linearAcceleration() const { return m_linearAcceleration; } | 32 DOMFloat32Array* linearAcceleration() const { return m_linearAcceleration; } |
| 32 | 33 |
| 33 void setPose(const device::blink::VRPosePtr&); | 34 void setPose(const WebGamepadPose &state); |
| 34 | 35 |
| 35 DECLARE_VIRTUAL_TRACE(); | 36 DECLARE_VIRTUAL_TRACE(); |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 VRPose(); | 39 GamepadPose(); |
| 39 | 40 |
| 40 DOMHighResTimeStamp m_timestamp; | 41 bool m_hasOrientation; |
| 42 bool m_hasPosition; |
| 43 |
| 41 Member<DOMFloat32Array> m_orientation; | 44 Member<DOMFloat32Array> m_orientation; |
| 42 Member<DOMFloat32Array> m_position; | 45 Member<DOMFloat32Array> m_position; |
| 43 Member<DOMFloat32Array> m_angularVelocity; | 46 Member<DOMFloat32Array> m_angularVelocity; |
| 44 Member<DOMFloat32Array> m_linearVelocity; | 47 Member<DOMFloat32Array> m_linearVelocity; |
| 45 Member<DOMFloat32Array> m_angularAcceleration; | 48 Member<DOMFloat32Array> m_angularAcceleration; |
| 46 Member<DOMFloat32Array> m_linearAcceleration; | 49 Member<DOMFloat32Array> m_linearAcceleration; |
| 47 }; | 50 }; |
| 48 | 51 |
| 49 } // namespace blink | 52 } // namespace blink |
| 50 | 53 |
| 51 #endif // VRPose_h | 54 #endif // VRPose_h |
| OLD | NEW |