Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(565)

Side by Side Diff: Source/modules/vr/VRHardwareUnit.h

Issue 848053002: Adding WebVR interface to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed compiler warning treated as an error on Windows Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
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 enum VREye {
21 VREyeLeft,
22 VREyeRight,
23 VREyeNone,
24 };
25
26 class VRHardwareUnit : public GarbageCollectedFinalized<VRHardwareUnit> {
27 public:
28 VRHardwareUnit();
29 virtual ~VRHardwareUnit();
30
31 void updateFromWebVRDevice(const WebVRDevice&);
32
33 void addDevicesToVector(HeapVector<Member<VRDevice>>&);
34
35 virtual unsigned index() const { return m_index; }
36 const String& hardwareUnitId() const { return m_hardwareUnitId; }
37
38 unsigned frameIndex() const { return m_frameIndex; }
39
40 VRPositionState* getPositionState();
41
42 void setFieldOfView(VREye, VRFieldOfView*);
43 VRFieldOfView* getCurrentEyeFieldOfView(VREye) const;
44
45 HMDVRDevice* hmd() const { return m_hmd; }
46 PositionSensorVRDevice* positionSensor() const { return m_positionSensor; }
47
48 virtual void trace(Visitor*);
49
50 private:
51 unsigned m_index;
52 String m_hardwareUnitId;
53
54 unsigned m_frameIndex;
55
56 Member<VRPositionState> m_positionState;
57 Member<VRFieldOfView> m_currentFOVLeft;
58 Member<VRFieldOfView> m_currentFOVRight;
59
60 // Device types
61 Member<HMDVRDevice> m_hmd;
62 Member<PositionSensorVRDevice> m_positionSensor;
63 };
64
65 } // namespace blink
66
67 #endif // VRHardwareUnit_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698