()
| 2132 | // ─── Quadtree ───────────────────────────────────────────────────── |
| 2133 | |
| 2134 | private rebuildQuadtree(): void { |
| 2135 | const visibleNodes: PixiNode[] = []; |
| 2136 | for (const node of this.nodes.values()) { |
| 2137 | if (node.visible) visibleNodes.push(node); |
| 2138 | } |
| 2139 | // In 3D mode, use the sprite's projected position for hit detection |
| 2140 | this._quadtree = quadtree<PixiNode>() |
| 2141 | .x((d) => (this.mode3d ? d.sprite.position.x : d.x)) |
| 2142 | .y((d) => (this.mode3d ? d.sprite.position.y : d.y)) |
| 2143 | .addAll(visibleNodes); |
| 2144 | this.lastQuadtreeRebuild = performance.now(); |
| 2145 | } |
| 2146 | |
| 2147 | /** Find the nearest node to (worldX, worldY) within maxDistance. */ |
| 2148 | findNodeAt( |
no test coverage detected