Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 0 additions & 80 deletions resources/chromium/webxr-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ class MockRuntime {
'secondary-views': xrSessionMojom.XRSessionFeature.SECONDARY_VIEWS,
'camera-access': xrSessionMojom.XRSessionFeature.CAMERA_ACCESS,
'layers': xrSessionMojom.XRSessionFeature.LAYERS,
'plane-detection': xrSessionMojom.XRSessionFeature.PLANE_DETECTION,
};

static _sessionModeToMojoMap = {
Expand Down Expand Up @@ -372,19 +371,6 @@ class MockRuntime {
"unsigned-short": xrSessionMojom.XRDepthDataFormat.kUnsignedShort,
};

static _semanticLabelToMojoMap = {
"other": vrMojom.XRSemanticLabel.kOther,
"floor": vrMojom.XRSemanticLabel.kFloor,
"wall": vrMojom.XRSemanticLabel.kWall,
"ceiling": vrMojom.XRSemanticLabel.kCeiling,
"table": vrMojom.XRSemanticLabel.kTable,
};

static _planeOrientationToMojoMap = {
"horizontal": vrMojom.XRPlaneOrientation.HORIZONTAL,
"vertical": vrMojom.XRPlaneOrientation.VERTICAL,
};


constructor(fakeDeviceInit, service) {
this.sessionClient_ = null;
Expand Down Expand Up @@ -412,9 +398,6 @@ class MockRuntime {
// ID of the next subscription to be assigned.
this.next_hit_test_id_ = 1n;

this.world_ = null;
this.worldDirty_ = false;

this.anchor_controllers_ = new Map();
// ID of the next anchor to be assigned.
this.next_anchor_id_ = 1n;
Expand Down Expand Up @@ -616,12 +599,10 @@ class MockRuntime {
// WebXR Test API Hit Test extensions
setWorld(world) {
this.world_ = world;
this.worldDirty_ = true;
}

clearWorld() {
this.world_ = null;
this.worldDirty_ = true;
}

// WebXR Test API Anchor extensions
Expand Down Expand Up @@ -1049,8 +1030,6 @@ class MockRuntime {

this._calculateAnchorInformation(frameData);

this._calculatePlaneInformation(frameData);

if (options.depthActive) {
this._calculateDepthInformation(frameData);
}
Expand Down Expand Up @@ -1431,65 +1410,6 @@ class MockRuntime {
}
}

// Private functions - plane detection implementation:

// Modifies passed in frameData to add plane detection results.
_calculatePlaneInformation(frameData) {
if (!this.enabledFeatures_.includes(xrSessionMojom.XRSessionFeature.PLANE_DETECTION)) {
return;
}

frameData.detectedPlanesData = {
allPlanesIds: [],
updatedPlanesData: []
};

if (!this.world_) {
this.worldDirty_ = false;
return;
}

for (let i = 0; i < this.world_.hitTestRegions.length; i++) {
const region = this.world_.hitTestRegions[i];
if (region.type !== "plane") {
continue;
}

// PlaneId is just an idValue (uint64). We can use the index in the hitTestRegions.
// Though 0 is an invalid id, so increment by 1.
const planeId = { idValue: BigInt(i + 1) };
frameData.detectedPlanesData.allPlanesIds.push(planeId);

// Only treat planes as updated if the world state was changed since last frame.
if (this.worldDirty_) {
const planeInfo = region.planeInfo;
if (planeInfo) {
let semanticLabel = null;
if (planeInfo.semanticLabel && planeInfo.semanticLabel in MockRuntime._semanticLabelToMojoMap) {
semanticLabel = MockRuntime._semanticLabelToMojoMap[planeInfo.semanticLabel];
}
const planeData = {
id: planeId,
orientation: MockRuntime._planeOrientationToMojoMap[planeInfo.orientation],
mojoFromPlane: getPoseFromTransform(planeInfo.origin),
semanticLabel: semanticLabel,
polygon: []
};

if (planeInfo.polygon) {
for (const point of planeInfo.polygon) {
planeData.polygon.push({ x: point.x, z: point.z });
}
}

frameData.detectedPlanesData.updatedPlanesData.push(planeData);
}
}
}

this.worldDirty_ = false;
}

// Private functions - depth sensing implementation:

/**
Expand Down

This file was deleted.

70 changes: 0 additions & 70 deletions webxr/plane-detection/xrFrame_detectedPlanes_plumbing.https.html

This file was deleted.

48 changes: 0 additions & 48 deletions webxr/plane-detection/xrPlane_identity.https.html

This file was deleted.

60 changes: 0 additions & 60 deletions webxr/plane-detection/xrPlane_lastChangedTime_no_change.https.html

This file was deleted.

43 changes: 0 additions & 43 deletions webxr/plane-detection/xrSession_initiateRoomCapture.https.html

This file was deleted.

Loading