(x: number, y: number, z = 0)
| 130 | if (tick.current !== 0) return; |
| 131 | const box = gl.domElement.getBoundingClientRect(); |
| 132 | const toScreen = (x: number, y: number, z = 0) => { |
| 133 | point.set(x, y, z).project(camera); |
| 134 | return { x: box.left + ((point.x + 1) / 2) * box.width, y: box.top + ((1 - point.y) / 2) * box.height }; |
| 135 | }; |
| 136 | const blockers: ScreenRect[] = (nameBoxes.current ?? []).map((name) => { |
| 137 | const a = toScreen(name.x - name.width / 2, name.y + name.height / 2), b = toScreen(name.x + name.width / 2, name.y - name.height / 2); |
| 138 | return { left: Math.min(a.x, b.x), right: Math.max(a.x, b.x), top: Math.min(a.y, b.y), bottom: Math.max(a.y, b.y) }; |
no outgoing calls
no test coverage detected