Fix editor regressions and add Blender scene and animated material import

This commit is contained in:
emil28092005
2026-09-12 00:53:20 +03:00
parent 1a0bf725fa
commit 6f497d1977
34 changed files with 1241 additions and 213 deletions
-27
View File
@@ -74,7 +74,6 @@ async function boot() {
const stick = document.getElementById("stick")!;
const knob = stick.querySelector("i")!;
let stickId: number | null = null;
let look: { id: number; x: number; y: number } | null = null;
const move = (event: PointerEvent) => {
if (event.pointerId !== stickId || runtime.paused) return;
const bounds = stick.getBoundingClientRect();
@@ -111,37 +110,11 @@ async function boot() {
runtime.touch[input] = false;
};
}
canvas.addEventListener("pointerdown", (event) => {
if (!firstPerson || runtime.paused) return;
if (event.pointerType === "mouse") {
const lock = canvas.requestPointerLock?.();
if (lock && typeof lock.catch === "function") lock.catch(() => {});
} else {
look = { id: event.pointerId, x: event.clientX, y: event.clientY };
canvas.setPointerCapture(event.pointerId);
}
});
canvas.addEventListener("pointermove", (event) => {
if (!look || look.id !== event.pointerId || runtime.paused) return;
runtime.lookBy(
(event.clientX - look.x) * 0.004,
(look.y - event.clientY) * 0.004,
);
look.x = event.clientX;
look.y = event.clientY;
});
const release = () => {
stickId = null;
look = null;
runtime.releaseInput();
knob.style.transform = "";
};
canvas.addEventListener("pointerup", () => {
look = null;
});
canvas.addEventListener("pointercancel", () => {
look = null;
});
window.addEventListener("blur", release);
document.addEventListener("visibilitychange", () => {
release();