diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-13 16:23:34 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-14 10:37:21 +0000 |
commit | 38a9a29f4f9436cace7f0e7abf9c586057df8a4e (patch) | |
tree | c4e8c458dc595bc0ddb435708fa2229edfd00bd4 /chromium/third_party/blink/renderer/modules/xr/xr_frame.cc | |
parent | e684a3455bcc29a6e3e66a004e352dea4e1141e7 (diff) | |
download | qtwebengine-chromium-38a9a29f4f9436cace7f0e7abf9c586057df8a4e.tar.gz |
BASELINE: Update Chromium to 73.0.3683.37
Change-Id: I08c9af2948b645f671e5d933aca1f7a90ea372f2
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/xr/xr_frame.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/modules/xr/xr_frame.cc | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/chromium/third_party/blink/renderer/modules/xr/xr_frame.cc b/chromium/third_party/blink/renderer/modules/xr/xr_frame.cc index f4404b8a678..34e6219ead8 100644 --- a/chromium/third_party/blink/renderer/modules/xr/xr_frame.cc +++ b/chromium/third_party/blink/renderer/modules/xr/xr_frame.cc @@ -4,56 +4,55 @@ #include "third_party/blink/renderer/modules/xr/xr_frame.h" -#include "third_party/blink/renderer/modules/xr/xr_coordinate_system.h" -#include "third_party/blink/renderer/modules/xr/xr_device_pose.h" #include "third_party/blink/renderer/modules/xr/xr_input_pose.h" #include "third_party/blink/renderer/modules/xr/xr_input_source.h" +#include "third_party/blink/renderer/modules/xr/xr_reference_space.h" #include "third_party/blink/renderer/modules/xr/xr_session.h" #include "third_party/blink/renderer/modules/xr/xr_view.h" +#include "third_party/blink/renderer/modules/xr/xr_viewer_pose.h" namespace blink { XRFrame::XRFrame(XRSession* session) : session_(session) {} -const HeapVector<Member<XRView>>& XRFrame::views() const { - return session_->views(); -} - -XRDevicePose* XRFrame::getDevicePose( - XRCoordinateSystem* coordinate_system) const { +XRViewerPose* XRFrame::getViewerPose(XRReferenceSpace* reference_space) const { session_->LogGetPose(); // If we don't have a valid base pose return null. Most common when tracking // is lost. - if (!base_pose_matrix_ || !coordinate_system) { + if (!base_pose_matrix_ || !reference_space) { return nullptr; } // Must use a coordinate system created from the same session. - if (coordinate_system->session() != session_) { + if (reference_space->session() != session_) { return nullptr; } std::unique_ptr<TransformationMatrix> pose = - coordinate_system->TransformBasePose(*base_pose_matrix_); + reference_space->TransformBasePose(*base_pose_matrix_); if (!pose) { return nullptr; } - return MakeGarbageCollected<XRDevicePose>(session(), std::move(pose)); + // Can only update an XRViewerPose's views with an invertible matrix. + if (!pose->IsInvertible()) { + return nullptr; + } + + return MakeGarbageCollected<XRViewerPose>(session(), std::move(pose)); } -XRInputPose* XRFrame::getInputPose( - XRInputSource* input_source, - XRCoordinateSystem* coordinate_system) const { - if (!input_source || !coordinate_system) { +XRInputPose* XRFrame::getInputPose(XRInputSource* input_source, + XRReferenceSpace* reference_space) const { + if (!input_source || !reference_space) { return nullptr; } // Must use an input source and coordinate system from the same session. if (input_source->session() != session_ || - coordinate_system->session() != session_) { + reference_space->session() != session_) { return nullptr; } @@ -68,7 +67,7 @@ XRInputPose* XRFrame::getInputPose( // Multiply the head pose and pointer transform to get the final pointer. std::unique_ptr<TransformationMatrix> pointer_pose = - coordinate_system->TransformBasePose(*base_pose_matrix_); + reference_space->TransformBasePose(*base_pose_matrix_); pointer_pose->Multiply(*(input_source->pointer_transform_matrix_)); return MakeGarbageCollected<XRInputPose>(std::move(pointer_pose), @@ -84,7 +83,7 @@ XRInputPose* XRFrame::getInputPose( // Just return the head pose as the pointer pose. std::unique_ptr<TransformationMatrix> pointer_pose = - coordinate_system->TransformBasePose(*base_pose_matrix_); + reference_space->TransformBasePose(*base_pose_matrix_); return MakeGarbageCollected<XRInputPose>( std::move(pointer_pose), nullptr, input_source->emulatedPosition()); @@ -96,7 +95,7 @@ XRInputPose* XRFrame::getInputPose( } std::unique_ptr<TransformationMatrix> grip_pose = - coordinate_system->TransformBaseInputPose( + reference_space->TransformBaseInputPose( *(input_source->base_pose_matrix_), *base_pose_matrix_); if (!grip_pose) { |