OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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 VRHardwareUnit_h | |
6 #define VRHardwareUnit_h | |
7 | |
8 #include "modules/vr/VRFieldOfView.h" | |
9 #include "modules/vr/VRPositionState.h" | |
10 #include "platform/heap/Handle.h" | |
11 #include "wtf/text/WTFString.h" | |
12 | |
13 namespace blink { | |
14 | |
15 class VRDevice; | |
16 class HMDVRDevice; | |
17 class NavigatorVRDevice; | |
18 class PositionSensorVRDevice; | |
19 | |
20 class VRHardwareUnit : public GarbageCollectedFinalized<VRHardwareUnit> { | |
21 public: | |
22 VRHardwareUnit(); | |
23 virtual ~VRHardwareUnit(); | |
24 | |
25 void updateFromWebVRDevice(const WebVRDevice&); | |
26 | |
27 void addDevicesToVector(HeapVector<Member<VRDevice>>&); | |
28 | |
29 virtual unsigned index() const { return m_index; } | |
30 const String& hardwareUnitId() const { return m_hardwareUnitId; } | |
31 | |
32 unsigned frameIndex() const { return m_frameIndex; } | |
33 | |
34 VRPositionState* getPositionState(double offset); | |
35 | |
36 void setFieldOfView(unsigned eyeIndex, VRFieldOfView*); | |
sof
2015/02/24 12:35:29
Are we bounded two just left&right eyes here (now
| |
37 VRFieldOfView* getCurrentEyeFieldOfView(unsigned eyeIndex) const; | |
38 virtual WebVRFieldOfView getFieldOfView(unsigned eyeIndex) const; | |
39 | |
40 HMDVRDevice* hmd() const { return m_hmd; } | |
41 PositionSensorVRDevice* positionSensor() const { return m_positionSensor; } | |
42 | |
43 virtual void trace(Visitor*); | |
44 | |
45 private: | |
46 unsigned m_index; | |
47 String m_hardwareUnitId; | |
48 | |
49 unsigned m_frameIndex; | |
50 | |
51 Member<VRPositionState> m_positionState; | |
52 Member<VRFieldOfView> m_currentFOVLeft; | |
53 Member<VRFieldOfView> m_currentFOVRight; | |
54 | |
55 // Device types | |
56 Member<HMDVRDevice> m_hmd; | |
57 Member<PositionSensorVRDevice> m_positionSensor; | |
58 }; | |
59 | |
60 } // namespace blink | |
61 | |
62 #endif // VRHardwareUnit_h | |
OLD | NEW |