Test optimizing quadtree

This commit is contained in:
2024-06-13 18:53:17 +02:00
parent 958ffa9ae9
commit 1d907c8ab9
6 changed files with 428 additions and 171 deletions

View File

@@ -28,7 +28,7 @@ export default class Input
static #dragCb?: (delta: Point, start: Point, end: Point, button: number) => void;
static #dragEndCb?: (start: Point, end: Point, button: number) => void;
static #wheelCb?: (delta: number) => void;
static #inputCb?: () => void;
static #inputCb?: (input: string) => void;
static init(canvas: HTMLCanvasElement)
{
@@ -95,7 +95,7 @@ export default class Input
{
Input.#wheelCb = cb;
}
static onInput(cb: () => void): void
static onInput(cb: (input: string) => void): void
{
Input.#inputCb = cb;
}
@@ -173,6 +173,6 @@ export default class Input
{
Input.#keys[e.key] = false;
Input.#inputCb && Input.#inputCb();
Input.#inputCb && Input.#inputCb(e.key);
}
}

View File

@@ -16,6 +16,10 @@ export default class Selector
{
return Selector.#selected;
}
static get selection(): Asset[]
{
return Selector.#assets;
}
static init(): void
{
Selector.#previewMesh = new Three.Box3Helper(new Three.Box3(), 0x2980B9);
@@ -25,7 +29,7 @@ export default class Selector
Renderer.scene.add(Selector.#previewMesh);
Renderer.scene.add(Selector.#ghostMesh);
Renderer.scene.add(Selector.#selectionMesh);
Selector.hide();
}
static preview(start: Point, end: Point): void