(axis: Vector3Like)
| 389 | const third = norm(cross(first, second)); |
| 390 | |
| 391 | const along = (axis: Vector3Like): { extent: number; middle: number } => { |
| 392 | let min = Number.POSITIVE_INFINITY; |
| 393 | let max = Number.NEGATIVE_INFINITY; |
| 394 | for (const point of usable) { |
| 395 | const value = dot(point, axis); |
| 396 | min = Math.min(min, value); |
| 397 | max = Math.max(max, value); |
| 398 | } |
| 399 | return { extent: max - min, middle: (min + max) / 2 }; |
| 400 | }; |
| 401 | const a0 = along(first); |
| 402 | const a1 = along(second); |
| 403 | const a2 = along(third); |