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

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: Addressed sigbjornf@'s epic amount of feedback 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 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 VRFieldOfView_h
6 #define VRFieldOfView_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "modules/vr/VRFieldOfViewInit.h"
10 #include "platform/heap/Handle.h"
11 #include "public/platform/WebVR.h"
12 #include "wtf/Forward.h"
13
14
15 namespace blink {
16
17 class VRFieldOfView final : public GarbageCollectedFinalized<VRFieldOfView>, pub lic ScriptWrappable {
haraken 2015/02/25 11:52:56 "Finalized" wouldn't be needed.
18 DEFINE_WRAPPERTYPEINFO();
19 public:
20 static VRFieldOfView* create(const VRFieldOfViewInit& fov)
21 {
22 return new VRFieldOfView(fov);
23 }
24
25 VRFieldOfView() : m_upDegrees(0.0), m_downDegrees(0.0), m_leftDegrees(0.0), m_rightDegrees(0.0)
26 {
27 }
28
29 VRFieldOfView(double upDegrees, double rightDegrees, double downDegrees, dou ble leftDegrees)
30 : m_upDegrees(0.0)
31 , m_downDegrees(0.0)
32 , m_leftDegrees(0.0)
33 , m_rightDegrees(0.0)
34 {
35 }
36
37 explicit VRFieldOfView(const VRFieldOfViewInit& fov)
38 : m_upDegrees(fov.upDegrees())
39 , m_downDegrees(fov.downDegrees())
40 , m_leftDegrees(fov.leftDegrees())
41 , m_rightDegrees(fov.rightDegrees())
42 {
43 }
44
45 explicit VRFieldOfView(const VRFieldOfView& fov)
46 : m_upDegrees(fov.m_upDegrees)
47 , m_downDegrees(fov.m_downDegrees)
48 , m_leftDegrees(fov.m_leftDegrees)
49 , m_rightDegrees(fov.m_rightDegrees)
50 {
51 }
52
53 ~VRFieldOfView()
54 {
55 }
56
57 double upDegrees() const { return m_upDegrees; }
58 double downDegrees() const { return m_downDegrees; }
59 double leftDegrees() const { return m_leftDegrees; }
60 double rightDegrees() const { return m_rightDegrees; }
61
62 void setUpDegrees(double value) { m_upDegrees = value; }
63 void setDownDegrees(double value) { m_downDegrees = value; }
64 void setLeftDegrees(double value) { m_leftDegrees = value; }
65 void setRightDegrees(double value) { m_rightDegrees = value; }
66
67 void setFromWebVRFieldOfView(const blink::WebVRFieldOfView& fov)
68 {
69 m_upDegrees = fov.upDegrees;
70 m_downDegrees = fov.downDegrees;
71 m_leftDegrees = fov.leftDegrees;
72 m_rightDegrees = fov.rightDegrees;
73 }
74
75 void setFromVRFieldOfView(const VRFieldOfView& fov)
76 {
77 m_upDegrees = fov.m_upDegrees;
78 m_downDegrees = fov.m_downDegrees;
79 m_leftDegrees = fov.m_leftDegrees;
80 m_rightDegrees = fov.m_rightDegrees;
81 }
82
83 virtual void trace(Visitor*)
84 {
85 }
86
87 private:
88 double m_upDegrees;
89 double m_downDegrees;
90 double m_leftDegrees;
91 double m_rightDegrees;
92 };
93
94 } // namespace blink
95
96 #endif // VRFieldOfView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698