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 VRPositionState_h | 5 #ifndef VRPositionState_h |
6 #define VRPositionState_h | 6 #define VRPositionState_h |
7 | 7 |
| 8 #include "bindings/core/v8/ScriptValue.h" |
8 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/dom/DOMPoint.h" | |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 #include "public/platform/modules/vr/WebVR.h" | 11 #include "public/platform/modules/vr/WebVR.h" |
12 #include "wtf/Forward.h" | 12 #include "wtf/Forward.h" |
13 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class VRPositionState final : public GarbageCollected<VRPositionState>, public S
criptWrappable { | 17 class VRPositionState final : public GarbageCollectedFinalized<VRPositionState>,
public ScriptWrappable { |
18 DEFINE_WRAPPERTYPEINFO(); | 18 DEFINE_WRAPPERTYPEINFO(); |
19 public: | 19 public: |
20 static VRPositionState* create() | 20 static VRPositionState* create() |
21 { | 21 { |
22 return new VRPositionState(); | 22 return new VRPositionState(); |
23 } | 23 } |
24 | 24 |
25 double timeStamp() const { return m_timeStamp; } | 25 double timeStamp() const { return m_timeStamp; } |
26 DOMPoint* orientation() const { return m_orientation; } | 26 ScriptValue& orientation(ScriptState*); |
27 DOMPoint* position() const { return m_position; } | 27 ScriptValue& position(ScriptState*); |
28 DOMPoint* angularVelocity() const { return m_angularVelocity; } | 28 ScriptValue& angularVelocity(ScriptState*); |
29 DOMPoint* linearVelocity() const { return m_linearVelocity; } | 29 ScriptValue& linearVelocity(ScriptState*); |
30 DOMPoint* angularAcceleration() const { return m_angularAcceleration; } | 30 ScriptValue& angularAcceleration(ScriptState*); |
31 DOMPoint* linearAcceleration() const { return m_linearAcceleration; } | 31 ScriptValue& linearAcceleration(ScriptState*); |
32 | 32 |
33 void setState(const WebHMDSensorState&); | 33 void setState(const WebHMDSensorState&); |
34 | 34 |
35 DECLARE_VIRTUAL_TRACE(); | 35 DECLARE_VIRTUAL_TRACE(); |
36 | 36 |
37 private: | 37 private: |
38 VRPositionState(); | 38 VRPositionState(); |
39 | 39 |
40 double m_timeStamp; | 40 double m_timeStamp; |
41 Member<DOMPoint> m_orientation; | 41 WebHMDSensorState m_state; |
42 Member<DOMPoint> m_position; | 42 ScriptValue m_orientation; |
43 Member<DOMPoint> m_angularVelocity; | 43 ScriptValue m_position; |
44 Member<DOMPoint> m_linearVelocity; | 44 ScriptValue m_angularVelocity; |
45 Member<DOMPoint> m_angularAcceleration; | 45 ScriptValue m_linearVelocity; |
46 Member<DOMPoint> m_linearAcceleration; | 46 ScriptValue m_angularAcceleration; |
| 47 ScriptValue m_linearAcceleration; |
47 }; | 48 }; |
48 | 49 |
49 } // namespace blink | 50 } // namespace blink |
50 | 51 |
51 #endif // VRPositionState_h | 52 #endif // VRPositionState_h |
OLD | NEW |