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

Side by Side Diff: third_party/WebKit/Source/modules/vr/VRFrameData.h

Issue 2331553002: Update WebVR interface to match the 1.1 spec (Closed)
Patch Set: Addressed further feedback Created 4 years, 3 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 2016 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 VRFrameData_h
6 #define VRFrameData_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/dom/DOMHighResTimeStamp.h"
10 #include "core/dom/DOMTypedArray.h"
11 #include "device/vr/vr_service.mojom-blink.h"
12 #include "platform/heap/Handle.h"
13 #include "wtf/Forward.h"
14
15 namespace blink {
16
17 class VREyeParameters;
18 class VRPose;
19
20 class VRFrameData final : public GarbageCollected<VRFrameData>, public ScriptWra ppable {
21 DEFINE_WRAPPERTYPEINFO();
22 public:
23 static VRFrameData* create()
24 {
25 return new VRFrameData();
26 }
27
28 VRFrameData();
29
30 DOMHighResTimeStamp timestamp() const { return m_timestamp; }
31 DOMFloat32Array* leftProjectionMatrix() const { return m_leftProjectionMatri x; }
32 DOMFloat32Array* leftViewMatrix() const { return m_leftViewMatrix; }
33 DOMFloat32Array* rightProjectionMatrix() const { return m_rightProjectionMat rix; }
34 DOMFloat32Array* rightViewMatrix() const { return m_rightViewMatrix; }
35 VRPose* pose() const { return m_pose; }
36
37 // Populate a the VRFrameData with a pose and the necessary eye parameters.
38 // TODO(bajones): The full frame data should be provided by the VRService,
39 // not computed here.
40 bool update(const device::blink::VRPosePtr&, VREyeParameters* leftEye, VREye Parameters* rightEye, float depthNear, float depthFar);
41
42 DECLARE_VIRTUAL_TRACE()
43
44 private:
45 DOMHighResTimeStamp m_timestamp;
46 Member<DOMFloat32Array> m_leftProjectionMatrix;
47 Member<DOMFloat32Array> m_leftViewMatrix;
48 Member<DOMFloat32Array> m_rightProjectionMatrix;
49 Member<DOMFloat32Array> m_rightViewMatrix;
50 Member<VRPose> m_pose;
51 };
52
53 } // namespace blink
54
55 #endif // VRStageParameters_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698