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

Side by Side Diff: third_party/WebKit/Source/modules/vr/VRPose.cpp

Issue 2268893003: Updated VRPose.timestamp to use same casing as WebVR spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/vr/VRPose.h" 5 #include "modules/vr/VRPose.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 namespace { 9 namespace {
10 10
11 DOMFloat32Array* mojoArrayToFloat32Array(const mojo::WTFArray<float>& vec) 11 DOMFloat32Array* mojoArrayToFloat32Array(const mojo::WTFArray<float>& vec)
12 { 12 {
13 if (vec.is_null()) 13 if (vec.is_null())
14 return nullptr; 14 return nullptr;
15 15
16 return DOMFloat32Array::create(&(vec.front()), vec.size()); 16 return DOMFloat32Array::create(&(vec.front()), vec.size());
17 } 17 }
18 18
19 } // namespace 19 } // namespace
20 20
21 VRPose::VRPose() 21 VRPose::VRPose()
22 : m_timeStamp(0.0) 22 : m_timestamp(0.0)
23 { 23 {
24 } 24 }
25 25
26 void VRPose::setPose(const device::blink::VRPosePtr& state) 26 void VRPose::setPose(const device::blink::VRPosePtr& state)
27 { 27 {
28 if (state.is_null()) 28 if (state.is_null())
29 return; 29 return;
30 30
31 m_timeStamp = state->timestamp; 31 m_timestamp = state->timestamp;
32 m_orientation = mojoArrayToFloat32Array(state->orientation); 32 m_orientation = mojoArrayToFloat32Array(state->orientation);
33 m_position = mojoArrayToFloat32Array(state->position); 33 m_position = mojoArrayToFloat32Array(state->position);
34 m_angularVelocity = mojoArrayToFloat32Array(state->angularVelocity); 34 m_angularVelocity = mojoArrayToFloat32Array(state->angularVelocity);
35 m_linearVelocity = mojoArrayToFloat32Array(state->linearVelocity); 35 m_linearVelocity = mojoArrayToFloat32Array(state->linearVelocity);
36 m_angularAcceleration = mojoArrayToFloat32Array(state->angularAcceleration); 36 m_angularAcceleration = mojoArrayToFloat32Array(state->angularAcceleration);
37 m_linearAcceleration = mojoArrayToFloat32Array(state->linearAcceleration); 37 m_linearAcceleration = mojoArrayToFloat32Array(state->linearAcceleration);
38 } 38 }
39 39
40 DEFINE_TRACE(VRPose) 40 DEFINE_TRACE(VRPose)
41 { 41 {
42 visitor->trace(m_orientation); 42 visitor->trace(m_orientation);
43 visitor->trace(m_position); 43 visitor->trace(m_position);
44 visitor->trace(m_angularVelocity); 44 visitor->trace(m_angularVelocity);
45 visitor->trace(m_linearVelocity); 45 visitor->trace(m_linearVelocity);
46 visitor->trace(m_angularAcceleration); 46 visitor->trace(m_angularAcceleration);
47 visitor->trace(m_linearAcceleration); 47 visitor->trace(m_linearAcceleration);
48 } 48 }
49 49
50 } // namespace blink 50 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRPose.h ('k') | third_party/WebKit/Source/modules/vr/VRPose.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698