| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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/VRFrameData.h" | 5 #include "modules/vr/VRFrameData.h" |
| 6 | 6 |
| 7 #include "modules/vr/VREyeParameters.h" | 7 #include "modules/vr/VREyeParameters.h" |
| 8 #include "modules/vr/VRPose.h" | 8 #include "modules/vr/VRPose.h" |
| 9 | 9 |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 VRFrameData::VRFrameData() : m_timestamp(0.0) { | 169 VRFrameData::VRFrameData() : m_timestamp(0.0) { |
| 170 m_leftProjectionMatrix = DOMFloat32Array::create(16); | 170 m_leftProjectionMatrix = DOMFloat32Array::create(16); |
| 171 m_leftViewMatrix = DOMFloat32Array::create(16); | 171 m_leftViewMatrix = DOMFloat32Array::create(16); |
| 172 m_rightProjectionMatrix = DOMFloat32Array::create(16); | 172 m_rightProjectionMatrix = DOMFloat32Array::create(16); |
| 173 m_rightViewMatrix = DOMFloat32Array::create(16); | 173 m_rightViewMatrix = DOMFloat32Array::create(16); |
| 174 m_pose = VRPose::create(); | 174 m_pose = VRPose::create(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 bool VRFrameData::update(const device::mojom::blink::VRPosePtr& pose, | 177 bool VRFrameData::update(const device::blink::VRPosePtr& pose, |
| 178 VREyeParameters* leftEye, | 178 VREyeParameters* leftEye, |
| 179 VREyeParameters* rightEye, | 179 VREyeParameters* rightEye, |
| 180 float depthNear, | 180 float depthNear, |
| 181 float depthFar) { | 181 float depthFar) { |
| 182 if (!pose) | 182 if (!pose) |
| 183 return false; | 183 return false; |
| 184 | 184 |
| 185 m_timestamp = pose->timestamp; | 185 m_timestamp = pose->timestamp; |
| 186 | 186 |
| 187 // Build the projection matrices | 187 // Build the projection matrices |
| (...skipping 23 matching lines...) Expand all Loading... |
| 211 | 211 |
| 212 DEFINE_TRACE(VRFrameData) { | 212 DEFINE_TRACE(VRFrameData) { |
| 213 visitor->trace(m_leftProjectionMatrix); | 213 visitor->trace(m_leftProjectionMatrix); |
| 214 visitor->trace(m_leftViewMatrix); | 214 visitor->trace(m_leftViewMatrix); |
| 215 visitor->trace(m_rightProjectionMatrix); | 215 visitor->trace(m_rightProjectionMatrix); |
| 216 visitor->trace(m_rightViewMatrix); | 216 visitor->trace(m_rightViewMatrix); |
| 217 visitor->trace(m_pose); | 217 visitor->trace(m_pose); |
| 218 } | 218 } |
| 219 | 219 |
| 220 } // namespace blink | 220 } // namespace blink |
| OLD | NEW |