OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 VRPose_h |
6 #define VRPose_h | 6 #define VRPose_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" | 10 #include "device/vr/vr_service.mojom-blink.h" |
12 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.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 VRPose final : public GarbageCollected<VRPose>, public ScriptWrappable { |
18 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
19 public: | 18 public: |
20 static VRPose* create() | 19 static VRPose* create() |
21 { | 20 { |
22 return new VRPose(); | 21 return new VRPose(); |
23 } | 22 } |
24 | 23 |
25 DOMHighResTimeStamp timestamp() const { return m_timestamp; } | |
26 DOMFloat32Array* orientation() const { return m_orientation; } | 24 DOMFloat32Array* orientation() const { return m_orientation; } |
27 DOMFloat32Array* position() const { return m_position; } | 25 DOMFloat32Array* position() const { return m_position; } |
28 DOMFloat32Array* angularVelocity() const { return m_angularVelocity; } | 26 DOMFloat32Array* angularVelocity() const { return m_angularVelocity; } |
29 DOMFloat32Array* linearVelocity() const { return m_linearVelocity; } | 27 DOMFloat32Array* linearVelocity() const { return m_linearVelocity; } |
30 DOMFloat32Array* angularAcceleration() const { return m_angularAcceleration;
} | 28 DOMFloat32Array* angularAcceleration() const { return m_angularAcceleration;
} |
31 DOMFloat32Array* linearAcceleration() const { return m_linearAcceleration; } | 29 DOMFloat32Array* linearAcceleration() const { return m_linearAcceleration; } |
32 | 30 |
33 void setPose(const device::blink::VRPosePtr&); | 31 void setPose(const device::blink::VRPosePtr&); |
34 | 32 |
35 DECLARE_VIRTUAL_TRACE(); | 33 DECLARE_VIRTUAL_TRACE(); |
36 | 34 |
37 private: | 35 private: |
38 VRPose(); | 36 VRPose(); |
39 | 37 |
40 DOMHighResTimeStamp m_timestamp; | |
41 Member<DOMFloat32Array> m_orientation; | 38 Member<DOMFloat32Array> m_orientation; |
42 Member<DOMFloat32Array> m_position; | 39 Member<DOMFloat32Array> m_position; |
43 Member<DOMFloat32Array> m_angularVelocity; | 40 Member<DOMFloat32Array> m_angularVelocity; |
44 Member<DOMFloat32Array> m_linearVelocity; | 41 Member<DOMFloat32Array> m_linearVelocity; |
45 Member<DOMFloat32Array> m_angularAcceleration; | 42 Member<DOMFloat32Array> m_angularAcceleration; |
46 Member<DOMFloat32Array> m_linearAcceleration; | 43 Member<DOMFloat32Array> m_linearAcceleration; |
47 }; | 44 }; |
48 | 45 |
49 } // namespace blink | 46 } // namespace blink |
50 | 47 |
51 #endif // VRPose_h | 48 #endif // VRPose_h |
OLD | NEW |