Skip to content
Snippets Groups Projects
Commit 073999c6 authored by Alexander Rose's avatar Alexander Rose
Browse files

added Box3D.scale

parent 5d983491
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,7 @@ namespace Box3D {
return { min, max }
}
/** Get size of the box */
/** Get size/extent of the box */
export function size(size: Vec3, box: Box3D): Vec3 {
return Vec3.sub(size, box.max, box.min);
}
......@@ -75,6 +75,12 @@ namespace Box3D {
return out
}
export function scale(out: Box3D, box: Box3D, scale: number) {
Vec3.scale(out.min, box.min, scale)
Vec3.scale(out.max, box.max, scale)
return out;
}
const tmpTransformV = Vec3()
/** Transform box with a Mat4 */
export function transform(out: Box3D, box: Box3D, m: Mat4): Box3D {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment