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

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

Issue 848053002: Adding WebVR interface to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 10 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 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 VRFieldOfView_h
6 #define VRFieldOfView_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "platform/heap/Handle.h"
10 #include "public/platform/WebVR.h"
11 #include "wtf/RefCounted.h"
12
13 namespace blink {
14
15 class VRFieldOfView final : public GarbageCollectedFinalized<VRFieldOfView>, pub lic ScriptWrappable {
16 DEFINE_WRAPPERTYPEINFO();
17 public:
18 static VRFieldOfView* create()
19 {
20 return new VRFieldOfView();
21 }
22
23 VRFieldOfView() : m_upDegrees(0.0), m_downDegrees(0.0), m_leftDegrees(0.0), m_rightDegrees(0.0)
24 {
25 }
26
27 VRFieldOfView(const VRFieldOfView& fov)
28 : m_upDegrees(fov.m_upDegrees)
29 , m_downDegrees(fov.m_downDegrees)
30 , m_leftDegrees(fov.m_leftDegrees)
31 , m_rightDegrees(fov.m_rightDegrees)
32 {
33 }
34
35 ~VRFieldOfView()
36 {
37 }
38
39 double upDegrees() const { return m_upDegrees; }
40 double downDegrees() const { return m_downDegrees; }
41 double leftDegrees() const { return m_leftDegrees; }
42 double rightDegrees() const { return m_rightDegrees; }
43
44 void setUpDegrees(double value) { m_upDegrees = value; }
45 void setDownDegrees(double value) { m_downDegrees = value; }
46 void setLeftDegrees(double value) { m_leftDegrees = value; }
47 void setRightDegrees(double value) { m_rightDegrees = value; }
48
49 void setFromWebVRFieldOfView(const blink::WebVRFieldOfView& fov)
50 {
51 m_upDegrees = fov.upDegrees;
52 m_downDegrees = fov.downDegrees;
53 m_leftDegrees = fov.leftDegrees;
54 m_rightDegrees = fov.rightDegrees;
55 }
56
57 void setFromVRFieldOfView(const VRFieldOfView& fov)
58 {
59 m_upDegrees = fov.m_upDegrees;
60 m_downDegrees = fov.m_downDegrees;
61 m_leftDegrees = fov.m_leftDegrees;
62 m_rightDegrees = fov.m_rightDegrees;
63 }
64
65 virtual void trace(Visitor*)
66 {
67 }
68
69 private:
70 double m_upDegrees;
71 double m_downDegrees;
72 double m_leftDegrees;
73 double m_rightDegrees;
74 };
75
76 } // namespace blink
77
78 #endif // VRFieldOfView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698