blob: c40afa397969308ac5ec24d5960abdfaeb04cab1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/modules/xr/xr_input_pose.h"
#include "third_party/blink/renderer/modules/xr/xr_utils.h"
namespace blink {
XRInputPose::XRInputPose(std::unique_ptr<TransformationMatrix> pointer_matrix,
std::unique_ptr<TransformationMatrix> grip_matrix,
bool emulated_position)
: pointer_matrix_(std::move(pointer_matrix)),
grip_matrix_(std::move(grip_matrix)),
emulated_position_(emulated_position) {}
XRInputPose::~XRInputPose() {}
DOMFloat32Array* XRInputPose::pointerMatrix() const {
if (!pointer_matrix_)
return nullptr;
return transformationMatrixToFloat32Array(*pointer_matrix_);
}
DOMFloat32Array* XRInputPose::gripMatrix() const {
if (!grip_matrix_)
return nullptr;
return transformationMatrixToFloat32Array(*grip_matrix_);
}
void XRInputPose::Trace(blink::Visitor* visitor) {
ScriptWrappable::Trace(visitor);
}
} // namespace blink
|