Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP debugging web entities input not working in Firefox. #216

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html style="pointer-events:none;">
<head>
<title><%= process.env.VRCA_PRODUCT_NAME %></title>

Expand Down
11 changes: 8 additions & 3 deletions src/modules/scene/css3DRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
constructor(element: HTMLElement, mesh: AbstractMesh) {
this._element = element;
this._element.style.position = "absolute";
this._element.style.pointerEvents = "auto";
this._element.style.pointerEvents = "none";
this._element.children[0].style.pointerEvents = "none"; // disable input on iframe tag

Check warning on line 39 in src/modules/scene/css3DRenderer.ts

View workflow job for this annotation

GitHub Actions / desktop-build (macos-latest)

Unsafe member access .pointerEvents on an `any` value

Check warning on line 39 in src/modules/scene/css3DRenderer.ts

View workflow job for this annotation

GitHub Actions / 🎉 Deploy

Unsafe member access .pointerEvents on an `any` value

Check warning on line 39 in src/modules/scene/css3DRenderer.ts

View workflow job for this annotation

GitHub Actions / ⚒️ Build

Unsafe member access .pointerEvents on an `any` value

Check warning on line 39 in src/modules/scene/css3DRenderer.ts

View workflow job for this annotation

GitHub Actions / desktop-build (ubuntu-20.04)

Unsafe member access .pointerEvents on an `any` value

Check warning on line 39 in src/modules/scene/css3DRenderer.ts

View workflow job for this annotation

GitHub Actions / desktop-build (windows-latest)

Unsafe member access .pointerEvents on an `any` value

this._mesh = mesh;
this._mesh.onDisposeObservable.add(() => {
Expand Down Expand Up @@ -356,8 +357,10 @@
*/
private _pickObject(event: PointerEvent): CSS3DObject | undefined {
if (this.scene) {
const pick = this.scene.pick(Math.round(event.offsetX), Math.round(event.offsetY));
console.log("Picking at: ", event.offsetX, event.offsetY, event);
const pick = this.scene.pick(event.offsetX, event.offsetY);
if (pick && pick.hit && pick.pickedMesh) {
console.log("Picked mesh with id: ", pick.pickedMesh.id);
return this._css3DObjects.get(pick.pickedMesh.id);
}
}
Expand All @@ -374,6 +377,7 @@
object.setPicked();
if (object.canGetFocus) {
this.attachControl();
console.debug("CSS 3D Object attached", object.element.children[0].src);
}
} else {
this.detachControl();
Expand All @@ -398,8 +402,9 @@
if (this._isAttachControl) {
// make babylon.js canvas and document body receive events
document.body.style.pointerEvents = "auto";
this._canvas.style.pointerEvents = "all";
this._canvas.style.pointerEvents = "auto";
this._isAttachControl = false;
console.debug("CSS 3D Object detached");
}
}
}
Loading