Commit c1d6a9db authored by Alex Cooper's avatar Alex Cooper Committed by Commit Bot

Cleanup some missed WebVr files

Bug: 960132
Change-Id: I5a867f3a3b70095edafe6478e9503ef03e0fc726
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1890987
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711312}
parent 76dc2efe
include_rules = [
"+mojo/public/cpp/bindings/binding.h",
"+device/vr/public/mojom/vr_service.mojom-blink.h",
"+device/vr/public/mojom/vr_service.mojom-blink-forward.h",
"+gpu/command_buffer/client/gles2_interface.h",
"+ui/gfx/geometry",
"+services/metrics/public/cpp/ukm_builders.h"
]
// Copyright 2015 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.
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_VR_VR_CONTROLLER_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_VR_VR_CONTROLLER_H_
#include <memory>
#include "base/macros.h"
#include "device/vr/public/mojom/vr_service.mojom-blink-forward.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/execution_context/context_lifecycle_observer.h"
#include "third_party/blink/renderer/modules/vr/vr_display.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/heap/heap_allocator.h"
#include "third_party/blink/renderer/platform/scheduler/public/frame_or_worker_scheduler.h"
namespace blink {
class NavigatorVR;
class VRController final : public GarbageCollected<VRController>,
public device::mojom::blink::VRServiceClient,
public ContextLifecycleObserver {
USING_GARBAGE_COLLECTED_MIXIN(VRController);
USING_PRE_FINALIZER(VRController, Dispose);
public:
VRController(NavigatorVR*);
~VRController() override;
void GetDisplays(ScriptPromiseResolver*);
void SetListeningForActivate(bool);
// VRServiceClient override.
void OnDeviceChanged() override;
void FocusChanged();
void Trace(blink::Visitor*) override;
mojo::Remote<device::mojom::blink::VRService>& Service() { return service_; }
private:
bool ShouldResolveGetDisplays();
void EnsureDisplay();
void OnGetDisplays();
void OnNonImmersiveSessionRequestReturned(
device::mojom::blink::RequestSessionResultPtr result);
void OnGetDevicesSuccess(ScriptPromiseResolver*, VRDisplayVector);
void OnImmersiveDisplayInfoReturned(
device::mojom::blink::VRDisplayInfoPtr info);
// ContextLifecycleObserver.
void ContextDestroyed(ExecutionContext*) override;
void Dispose();
void LogGetDisplayResult();
Member<NavigatorVR> navigator_vr_;
Member<VRDisplay> display_;
// True if we don't have an outstanding call to GetImmersiveVRDisplayInfo, so
// we know what the "latest" immersive display info is.
bool have_latest_immersive_info_ = false;
// True if the call to request a non-immersive session has returned.
bool nonimmersive_session_returned_ = false;
device::mojom::blink::RequestSessionResultPtr nonimmersive_session_;
bool has_presentation_capable_display_ = false;
bool disposed_ = false;
bool pending_listening_for_activate_ = false;
bool listening_for_activate_ = false;
HeapDeque<Member<ScriptPromiseResolver>> pending_promise_resolvers_;
mojo::Remote<device::mojom::blink::VRService> service_;
mojo::Receiver<device::mojom::blink::VRServiceClient> receiver_{this};
FrameOrWorkerScheduler::SchedulingAffectingFeatureHandle
feature_handle_for_scheduler_;
DISALLOW_COPY_AND_ASSIGN(VRController);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_VR_VR_CONTROLLER_H_
This diff is collapsed.
// Copyright 2015 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/vr/vr_eye_parameters.h"
#include "device/vr/public/mojom/vr_service.mojom-blink.h"
#include "third_party/blink/renderer/platform/transforms/transformation_matrix.h"
namespace blink {
VREyeParameters::VREyeParameters(
const device::mojom::blink::VREyeParametersPtr& eye_parameters,
double render_scale) {
// This only works if the transform only has the translation component.
// However, WebVR never worked with angled screens anyways.
const TransformationMatrix matrix(eye_parameters->head_from_eye.matrix());
offset_ = DOMFloat32Array::Create(3);
offset_->Data()[0] = matrix.M41(); // x translation
offset_->Data()[1] = matrix.M42(); // y translation
offset_->Data()[2] = matrix.M43(); // z translation
field_of_view_ = MakeGarbageCollected<VRFieldOfView>();
field_of_view_->SetUpDegrees(eye_parameters->field_of_view->up_degrees);
field_of_view_->SetDownDegrees(eye_parameters->field_of_view->down_degrees);
field_of_view_->SetLeftDegrees(eye_parameters->field_of_view->left_degrees);
field_of_view_->SetRightDegrees(eye_parameters->field_of_view->right_degrees);
render_width_ = eye_parameters->render_width * render_scale;
render_height_ = eye_parameters->render_height * render_scale;
}
DOMFloat32Array* VREyeParameters::offset() const {
return DOMFloat32Array::Create(offset_->Data(), 3);
}
void VREyeParameters::Trace(blink::Visitor* visitor) {
visitor->Trace(offset_);
visitor->Trace(field_of_view_);
ScriptWrappable::Trace(visitor);
}
} // namespace blink
// Copyright 2015 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.
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_VR_VR_EYE_PARAMETERS_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_VR_VR_EYE_PARAMETERS_H_
#include "device/vr/public/mojom/vr_service.mojom-blink-forward.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h"
#include "third_party/blink/renderer/modules/vr/vr_field_of_view.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"
namespace blink {
class VREyeParameters final : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
explicit VREyeParameters(const device::mojom::blink::VREyeParametersPtr&,
double render_scale);
DOMFloat32Array* offset() const;
DOMFloat32Array* offsetInternal() const { return offset_; }
VRFieldOfView* FieldOfView() const { return field_of_view_; }
uint32_t renderWidth() const { return render_width_; }
uint32_t renderHeight() const { return render_height_; }
void Trace(blink::Visitor*) override;
private:
Member<DOMFloat32Array> offset_;
Member<VRFieldOfView> field_of_view_;
uint32_t render_width_;
uint32_t render_height_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_VR_VR_EYE_PARAMETERS_H_
// Copyright 2016 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/vr/vr_frame_data.h"
#include <cmath>
#include "device/vr/public/mojom/vr_service.mojom-blink.h"
#include "third_party/blink/renderer/modules/vr/vr_eye_parameters.h"
#include "third_party/blink/renderer/modules/vr/vr_pose.h"
#include "third_party/blink/renderer/platform/float_point_3d.h"
namespace {
// TODO(bajones): All of the matrix math here is temporary. It will be removed
// once the VRService has been updated to allow the underlying VR APIs to
// provide the projection and view matrices directly.
// Build a projection matrix from a field of view and near/far planes.
void ProjectionFromFieldOfView(blink::DOMFloat32Array* out_array,
blink::VRFieldOfView* fov,
float depth_near,
float depth_far) {
float up_tan = tanf(fov->UpDegrees() * M_PI / 180.0);
float down_tan = tanf(fov->DownDegrees() * M_PI / 180.0);
float left_tan = tanf(fov->LeftDegrees() * M_PI / 180.0);
float right_tan = tanf(fov->RightDegrees() * M_PI / 180.0);
float x_scale = 2.0f / (left_tan + right_tan);
float y_scale = 2.0f / (up_tan + down_tan);
float* out = out_array->Data();
out[0] = x_scale;
out[1] = 0.0f;
out[2] = 0.0f;
out[3] = 0.0f;
out[4] = 0.0f;
out[5] = y_scale;
out[6] = 0.0f;
out[7] = 0.0f;
out[8] = -((left_tan - right_tan) * x_scale * 0.5);
out[9] = ((up_tan - down_tan) * y_scale * 0.5);
out[10] = (depth_near + depth_far) / (depth_near - depth_far);
out[11] = -1.0f;
out[12] = 0.0f;
out[13] = 0.0f;
out[14] = (2 * depth_far * depth_near) / (depth_near - depth_far);
out[15] = 0.0f;
}
// Create a matrix from a rotation and translation.
void MatrixFromRotationTranslation(
blink::DOMFloat32Array* out_array,
const base::Optional<gfx::Quaternion>& rotation,
const base::Optional<blink::FloatPoint3D>& translation) {
// Quaternion math
float x = rotation ? rotation->x() : 0.0f;
float y = rotation ? rotation->y() : 0.0f;
float z = rotation ? rotation->z() : 0.0f;
float w = rotation ? rotation->w() : 1.0f;
float x2 = x + x;
float y2 = y + y;
float z2 = z + z;
float xx = x * x2;
float xy = x * y2;
float xz = x * z2;
float yy = y * y2;
float yz = y * z2;
float zz = z * z2;
float wx = w * x2;
float wy = w * y2;
float wz = w * z2;
float* out = out_array->Data();
out[0] = 1 - (yy + zz);
out[1] = xy + wz;
out[2] = xz - wy;
out[3] = 0;
out[4] = xy - wz;
out[5] = 1 - (xx + zz);
out[6] = yz + wx;
out[7] = 0;
out[8] = xz + wy;
out[9] = yz - wx;
out[10] = 1 - (xx + yy);
out[11] = 0;
out[12] = translation ? translation->X() : 0.0f;
out[13] = translation ? translation->Y() : 0.0f;
out[14] = translation ? translation->Z() : 0.0f;
out[15] = 1;
}
// Translate a matrix
void MatrixTranslate(blink::DOMFloat32Array* out_array,
const blink::DOMFloat32Array* translation) {
if (!translation)
return;
float x = translation->Data()[0];
float y = translation->Data()[1];
float z = translation->Data()[2];
float* out = out_array->Data();
out[12] = out[0] * x + out[4] * y + out[8] * z + out[12];
out[13] = out[1] * x + out[5] * y + out[9] * z + out[13];
out[14] = out[2] * x + out[6] * y + out[10] * z + out[14];
out[15] = out[3] * x + out[7] * y + out[11] * z + out[15];
}
bool MatrixInvert(blink::DOMFloat32Array* out_array) {
float* out = out_array->Data();
float a00 = out[0];
float a01 = out[1];
float a02 = out[2];
float a03 = out[3];
float a10 = out[4];
float a11 = out[5];
float a12 = out[6];
float a13 = out[7];
float a20 = out[8];
float a21 = out[9];
float a22 = out[10];
float a23 = out[11];
float a30 = out[12];
float a31 = out[13];
float a32 = out[14];
float a33 = out[15];
float b00 = a00 * a11 - a01 * a10;
float b01 = a00 * a12 - a02 * a10;
float b02 = a00 * a13 - a03 * a10;
float b03 = a01 * a12 - a02 * a11;
float b04 = a01 * a13 - a03 * a11;
float b05 = a02 * a13 - a03 * a12;
float b06 = a20 * a31 - a21 * a30;
float b07 = a20 * a32 - a22 * a30;
float b08 = a20 * a33 - a23 * a30;
float b09 = a21 * a32 - a22 * a31;
float b10 = a21 * a33 - a23 * a31;
float b11 = a22 * a33 - a23 * a32;
// Calculate the determinant
float det =
b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;
if (!det)
return false;
det = 1.0 / det;
out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;
out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;
out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;
out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;
out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;
out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;
out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;
out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;
out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;
out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;
out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;
out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;
out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;
out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;
out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;
out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;
return true;
}
blink::DOMFloat32Array* EnsureMatrix(blink::DOMFloat32Array* existing) {
if (!existing || existing->length() != 16) {
return blink::DOMFloat32Array::Create(16);
}
return existing;
}
} // namespace
namespace blink {
VRFrameData::VRFrameData() {
left_projection_matrix_ = DOMFloat32Array::Create(16);
left_view_matrix_ = DOMFloat32Array::Create(16);
right_projection_matrix_ = DOMFloat32Array::Create(16);
right_view_matrix_ = DOMFloat32Array::Create(16);
pose_ = VRPose::Create();
}
bool VRFrameData::Update(const device::mojom::blink::VRPosePtr& pose,
VREyeParameters* left_eye,
VREyeParameters* right_eye,
float depth_near,
float depth_far) {
VRFieldOfView* fov_left;
VRFieldOfView* fov_right;
if (left_eye && right_eye) {
fov_left = left_eye->FieldOfView();
fov_right = right_eye->FieldOfView();
} else {
DCHECK(!left_eye && !right_eye);
fov_left = fov_right = MakeGarbageCollected<VRFieldOfView>(45, 45, 45, 45);
}
// Build the projection matrices
left_projection_matrix_ = EnsureMatrix(left_projection_matrix_);
ProjectionFromFieldOfView(left_projection_matrix_, fov_left, depth_near,
depth_far);
right_projection_matrix_ = EnsureMatrix(right_projection_matrix_);
ProjectionFromFieldOfView(right_projection_matrix_, fov_right, depth_near,
depth_far);
// Build the view matrices
left_view_matrix_ = EnsureMatrix(left_view_matrix_);
MatrixFromRotationTranslation(left_view_matrix_, pose->orientation,
pose->position);
right_view_matrix_ = EnsureMatrix(right_view_matrix_);
MatrixFromRotationTranslation(right_view_matrix_, pose->orientation,
pose->position);
if (left_eye && right_eye) {
MatrixTranslate(left_view_matrix_, left_eye->offsetInternal());
MatrixTranslate(right_view_matrix_, right_eye->offsetInternal());
}
if (!MatrixInvert(left_view_matrix_) || !MatrixInvert(right_view_matrix_))
return false;
// Set the pose
pose_->SetPose(pose);
return true;
}
void VRFrameData::Trace(blink::Visitor* visitor) {
visitor->Trace(left_projection_matrix_);
visitor->Trace(left_view_matrix_);
visitor->Trace(right_projection_matrix_);
visitor->Trace(right_view_matrix_);
visitor->Trace(pose_);
ScriptWrappable::Trace(visitor);
}
} // namespace blink
// Copyright 2016 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.
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_VR_VR_FRAME_DATA_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_VR_VR_FRAME_DATA_H_
#include "device/vr/public/mojom/vr_service.mojom-blink-forward.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"
namespace blink {
class VREyeParameters;
class VRPose;
class VRFrameData final : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
static VRFrameData* Create() { return MakeGarbageCollected<VRFrameData>(); }
VRFrameData();
DOMFloat32Array* leftProjectionMatrix() const {
return left_projection_matrix_;
}
DOMFloat32Array* leftViewMatrix() const { return left_view_matrix_; }
DOMFloat32Array* rightProjectionMatrix() const {
return right_projection_matrix_;
}
DOMFloat32Array* rightViewMatrix() const { return right_view_matrix_; }
VRPose* pose() const { return pose_; }
// Populate a the VRFrameData with a pose and the necessary eye parameters.
// TODO(bajones): The full frame data should be provided by the VRService,
// not computed here.
bool Update(const device::mojom::blink::VRPosePtr&,
VREyeParameters* left_eye,
VREyeParameters* right_eye,
float depth_near,
float depth_far);
void Trace(blink::Visitor*) override;
private:
Member<DOMFloat32Array> left_projection_matrix_;
Member<DOMFloat32Array> left_view_matrix_;
Member<DOMFloat32Array> right_projection_matrix_;
Member<DOMFloat32Array> right_view_matrix_;
Member<VRPose> pose_;
};
} // namespace blink
#endif // VRStageParameters_h
// Copyright 2015 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/vr/vr_pose.h"
#include "device/vr/public/mojom/vr_service.mojom-blink.h"
#include "third_party/blink/renderer/platform/float_point_3d.h"
namespace blink {
namespace {
DOMFloat32Array* QuaternionToFloat32Array(
const base::Optional<gfx::Quaternion>& quat) {
if (!quat)
return nullptr;
auto* dom_array = DOMFloat32Array::Create(4);
float* data = dom_array->Data();
data[0] = quat->x();
data[1] = quat->y();
data[2] = quat->z();
data[3] = quat->w();
return dom_array;
}
DOMFloat32Array* Vector3dFToFloat32Array(
const base::Optional<gfx::Vector3dF>& vec) {
if (!vec)
return nullptr;
auto* dom_array = DOMFloat32Array::Create(3);
float* data = dom_array->Data();
data[0] = vec->x();
data[1] = vec->y();
data[2] = vec->z();
return dom_array;
}
DOMFloat32Array* WebPoint3DToFloat32Array(
const base::Optional<FloatPoint3D>& p) {
if (!p)
return nullptr;
auto* dom_array = DOMFloat32Array::Create(3);
float* data = dom_array->Data();
data[0] = p->X();
data[1] = p->Y();
data[2] = p->Z();
return dom_array;
}
} // namespace
VRPose::VRPose() = default;
void VRPose::SetPose(const device::mojom::blink::VRPosePtr& state) {
if (state.is_null())
return;
orientation_ = QuaternionToFloat32Array(state->orientation);
position_ = WebPoint3DToFloat32Array(state->position);
angular_velocity_ = Vector3dFToFloat32Array(state->angular_velocity);
linear_velocity_ = Vector3dFToFloat32Array(state->linear_velocity);
angular_acceleration_ = Vector3dFToFloat32Array(state->angular_acceleration);
linear_acceleration_ = Vector3dFToFloat32Array(state->linear_acceleration);
}
void VRPose::Trace(blink::Visitor* visitor) {
visitor->Trace(orientation_);
visitor->Trace(position_);
visitor->Trace(angular_velocity_);
visitor->Trace(linear_velocity_);
visitor->Trace(angular_acceleration_);
visitor->Trace(linear_acceleration_);
ScriptWrappable::Trace(visitor);
}
} // namespace blink
// Copyright 2015 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.
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_VR_VR_POSE_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_VR_VR_POSE_H_
#include "device/vr/public/mojom/vr_service.mojom-blink-forward.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"
namespace blink {
class VRPose final : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
static VRPose* Create() { return MakeGarbageCollected<VRPose>(); }
VRPose();
DOMFloat32Array* orientation() const { return orientation_; }
DOMFloat32Array* position() const { return position_; }
DOMFloat32Array* angularVelocity() const { return angular_velocity_; }
DOMFloat32Array* linearVelocity() const { return linear_velocity_; }
DOMFloat32Array* angularAcceleration() const { return angular_acceleration_; }
DOMFloat32Array* linearAcceleration() const { return linear_acceleration_; }
void SetPose(const device::mojom::blink::VRPosePtr&);
void Trace(blink::Visitor*) override;
private:
Member<DOMFloat32Array> orientation_;
Member<DOMFloat32Array> position_;
Member<DOMFloat32Array> angular_velocity_;
Member<DOMFloat32Array> linear_velocity_;
Member<DOMFloat32Array> angular_acceleration_;
Member<DOMFloat32Array> linear_acceleration_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_VR_VR_POSE_H_
// Copyright 2016 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/vr/vr_stage_parameters.h"
#include "device/vr/public/mojom/vr_service.mojom-blink.h"
#include "third_party/blink/renderer/modules/xr/xr_utils.h"
#include "third_party/blink/renderer/platform/transforms/transformation_matrix.h"
namespace blink {
VRStageParameters::VRStageParameters() : size_x_(0.0f), size_z_(0.0f) {
// Set the sitting to standing transform to identity matrix
standing_transform_ = DOMFloat32Array::Create(16);
standing_transform_->Data()[0] = 1.0f;
standing_transform_->Data()[5] = 1.0f;
standing_transform_->Data()[10] = 1.0f;
standing_transform_->Data()[15] = 1.0f;
}
void VRStageParameters::Update(
const device::mojom::blink::VRStageParametersPtr& stage) {
standing_transform_ = transformationMatrixToDOMFloat32Array(
TransformationMatrix(stage->standing_transform.matrix()));
size_x_ = stage->size_x;
size_z_ = stage->size_z;
}
void VRStageParameters::Trace(blink::Visitor* visitor) {
visitor->Trace(standing_transform_);
ScriptWrappable::Trace(visitor);
}
} // namespace blink
// Copyright 2016 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.
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_VR_VR_STAGE_PARAMETERS_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_VR_VR_STAGE_PARAMETERS_H_
#include "device/vr/public/mojom/vr_service.mojom-blink-forward.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"
namespace blink {
class VRStageParameters final : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
VRStageParameters();
DOMFloat32Array* sittingToStandingTransform() const {
return standing_transform_;
}
float sizeX() const { return size_x_; }
float sizeZ() const { return size_z_; }
void Update(const device::mojom::blink::VRStageParametersPtr&);
void Trace(blink::Visitor*) override;
private:
Member<DOMFloat32Array> standing_transform_;
float size_x_;
float size_z_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_VR_VR_STAGE_PARAMETERS_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment