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

Update webxr-test-api method names to floorOrigin

Per feedback on the spec and updates to the comments about what an
origin actually is, the API method names and dictionary values were
updated from localToFloorTransform to the more accurate floorOrigin. The
current usage of these items actually matches the new name and therefore
were previously improperly named.

Bug: 979316
Change-Id: I9deedf9cf25e804135251b8e20a30d89f0eb6276
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1700176
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Bill Orr <billorr@chromium.org>
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: default avatarBill Orr <billorr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#677129}
parent c0a85c7d
...@@ -226,8 +226,8 @@ class MockRuntime { ...@@ -226,8 +226,8 @@ class MockRuntime {
this.setViewerOrigin(fakeDeviceInit.viewerOrigin); this.setViewerOrigin(fakeDeviceInit.viewerOrigin);
} }
if (fakeDeviceInit.localToFloorLevelTransform != null) { if (fakeDeviceInit.floorOrigin != null) {
this.setLocalToFloorLevelTransform(fakeDeviceInit.localToFloorLevelTransform); this.setFloorOrigin(fakeDeviceInit.floorOrigin);
} }
// This appropriately handles if the coordinates are null // This appropriately handles if the coordinates are null
...@@ -312,7 +312,7 @@ class MockRuntime { ...@@ -312,7 +312,7 @@ class MockRuntime {
} }
} }
setLocalToFloorLevelTransform(transform) { setFloorOrigin(floorOrigin) {
if (!this.displayInfo_.stageParameters) { if (!this.displayInfo_.stageParameters) {
this.displayInfo_.stageParameters = default_stage_parameters; this.displayInfo_.stageParameters = default_stage_parameters;
this.displayInfo_.stageParameters.bounds = this.bounds_; this.displayInfo_.stageParameters.bounds = this.bounds_;
...@@ -320,14 +320,14 @@ class MockRuntime { ...@@ -320,14 +320,14 @@ class MockRuntime {
this.displayInfo_.stageParameters.standingTransform = new gfx.mojom.Transform(); this.displayInfo_.stageParameters.standingTransform = new gfx.mojom.Transform();
this.displayInfo_.stageParameters.standingTransform.matrix = this.displayInfo_.stageParameters.standingTransform.matrix =
getMatrixFromTransform(transform); getMatrixFromTransform(floorOrigin);
if (this.sessionClient_.ptr.isBound()) { if (this.sessionClient_.ptr.isBound()) {
this.sessionClient_.onChanged(this.displayInfo_); this.sessionClient_.onChanged(this.displayInfo_);
} }
} }
clearLocalToFloorLevelTransform() { clearFloorOrigin() {
if (this.displayInfo_.stageParameters) { if (this.displayInfo_.stageParameters) {
this.displayInfo_.stageParameters = null; this.displayInfo_.stageParameters = null;
......
...@@ -55,12 +55,12 @@ const VALID_GRIP_WITH_POINTER_OFFSET = ...@@ -55,12 +55,12 @@ const VALID_GRIP_WITH_POINTER_OFFSET =
// A Valid Local to floor matrix/transform for when we don't care about specific // A Valid Local to floor matrix/transform for when we don't care about specific
// values. Note that these should be identical, just different representations. // values. Note that these should be identical, just different representations.
const VALID_LOCAL_TO_FLOOR_MATRIX = [1, 0, 0, 0, const VALID_FLOOR_ORIGIN_MATRIX = [1, 0, 0, 0,
0, 1, 0, 0, 0, 1, 0, 0,
0, 0, 1, 0, 0, 0, 1, 0,
1, 1.65, -1, 1]; 1, 1.65, -1, 1];
const VALID_LOCAL_TO_FLOOR_TRANSFORM = { const VALID_FLOOR_ORIGIN = {
position: [1.0, 1.65, -1.0], position: [1.0, 1.65, -1.0],
orientation: [0, 0, 0, 1] orientation: [0, 0, 0, 1]
}; };
......
...@@ -14,7 +14,7 @@ let fakeDeviceInitParams = { ...@@ -14,7 +14,7 @@ let fakeDeviceInitParams = {
supportsImmersive: true, supportsImmersive: true,
views: VALID_VIEWS, views: VALID_VIEWS,
viewerOrigin: IDENTITY_TRANSFORM, viewerOrigin: IDENTITY_TRANSFORM,
localToFloorLevelTransform: VALID_LOCAL_TO_FLOOR_TRANSFORM floorOrigin: VALID_FLOOR_ORIGIN
}; };
let testFunction = function(session, fakeDeviceController, t) { let testFunction = function(session, fakeDeviceController, t) {
......
...@@ -32,7 +32,7 @@ let testFunction = function(session, fakeDeviceController, t) { ...@@ -32,7 +32,7 @@ let testFunction = function(session, fakeDeviceController, t) {
assert_greater_than(poseMatrix[13], 1.0); assert_greater_than(poseMatrix[13], 1.0);
assert_approx_equals(poseMatrix[14], 0.0, FLOAT_EPSILON); assert_approx_equals(poseMatrix[14], 0.0, FLOAT_EPSILON);
fakeDeviceController.setLocalToFloorLevelTransform(VALID_LOCAL_TO_FLOOR_TRANSFORM); fakeDeviceController.setFloorOrigin(VALID_FLOOR_ORIGIN);
// Need to request one animation frame for the new stage transform to // Need to request one animation frame for the new stage transform to
// propagate before we check that it's what we expect. // propagate before we check that it's what we expect.
...@@ -49,7 +49,7 @@ let testFunction = function(session, fakeDeviceController, t) { ...@@ -49,7 +49,7 @@ let testFunction = function(session, fakeDeviceController, t) {
assert_not_equals(pose, null); assert_not_equals(pose, null);
let poseMatrix = pose.transform.matrix; let poseMatrix = pose.transform.matrix;
assert_matrix_approx_equals(poseMatrix, VALID_LOCAL_TO_FLOOR_MATRIX, FLOAT_EPSILON); assert_matrix_approx_equals(poseMatrix, VALID_FLOOR_ORIGIN_MATRIX, FLOAT_EPSILON);
}); });
// Finished. // Finished.
......
...@@ -17,7 +17,7 @@ let fakeDeviceInitParams = { ...@@ -17,7 +17,7 @@ let fakeDeviceInitParams = {
supportsImmersive: true, supportsImmersive: true,
views: VALID_VIEWS, views: VALID_VIEWS,
viewerOrigin: IDENTITY_TRANSFORM, viewerOrigin: IDENTITY_TRANSFORM,
localToFloorLevelTransform: VALID_LOCAL_TO_FLOOR_TRANSFORM floorOrigin: VALID_FLOOR_ORIGIN
}; };
let requestSessionModes = [ let requestSessionModes = [
...@@ -48,7 +48,7 @@ let testFunction = function(session, t, fakeDeviceController) { ...@@ -48,7 +48,7 @@ let testFunction = function(session, t, fakeDeviceController) {
assert_not_equals(pose, null); assert_not_equals(pose, null);
let poseMatrix = pose.transform.matrix; let poseMatrix = pose.transform.matrix;
assert_matrices_approx_equal(poseMatrix, VALID_LOCAL_TO_FLOOR_MATRIX); assert_matrices_approx_equal(poseMatrix, VALID_FLOOR_ORIGIN_MATRIX);
// If an explicit array of bounds points was not provided then the // If an explicit array of bounds points was not provided then the
// bounds geometry should represent the four corners of the rectangle // bounds geometry should represent the four corners of the rectangle
......
...@@ -40,7 +40,7 @@ const fakeDeviceInitParams = { ...@@ -40,7 +40,7 @@ const fakeDeviceInitParams = {
supportsImmersive: true, supportsImmersive: true,
views: VIEWS_WITH_OFFSET, views: VIEWS_WITH_OFFSET,
viewerOrigin: IDENTITY_TRANSFORM, viewerOrigin: IDENTITY_TRANSFORM,
localToFloorLevelTransform: FLOOR_TRANSFORM, floorOrigin: FLOOR_TRANSFORM,
boundsCoordinates: [ boundsCoordinates: [
{ x: 1, z: -1.5 }, { x: 1, z: -1.5 },
{ x: 1, z: 1.5 }, { x: 1, z: 1.5 },
......
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