mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-22 05:15:32 +01:00
17 lines
419 B
TypeScript
17 lines
419 B
TypeScript
import { BoundingBox } from "../protos";
|
|
|
|
export function unionBoundingBox(a: BoundingBox, b: BoundingBox) {
|
|
return {
|
|
min: {
|
|
x: Math.min(a.min!.x, b.min!.x),
|
|
y: Math.min(a.min!.y, b.min!.y),
|
|
z: Math.min(a.min!.z, b.min!.z),
|
|
},
|
|
max: {
|
|
x: Math.max(a.max!.x, b.max!.x),
|
|
y: Math.max(a.max!.y, b.max!.y),
|
|
z: Math.max(a.max!.z, b.max!.z),
|
|
},
|
|
} satisfies BoundingBox;
|
|
}
|