From e19ce0c5eb9b6df6e5672793bc25f4e9f693a3cb Mon Sep 17 00:00:00 2001 From: Lajos Meszaros Date: Wed, 20 Dec 2023 20:53:52 +0100 Subject: [PATCH] feat(utils/pointToBox): halve size parameter --- src/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers.ts b/src/helpers.ts index 8838e34f..4e8f1560 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -166,7 +166,7 @@ export const numberOfVertices = (geometry: BufferGeometry) => { * @returns the generated Box3 object */ export const pointToBox = (point: Vector3, size: number | Vector3) => { - size = typeof size === 'number' ? new Vector3(size, size, size) : size + size = typeof size === 'number' ? new Vector3(size / 2, size / 2, size / 2) : size.divideScalar(2) const min = point.clone().sub(size) const max = point.clone().add(size) return new Box3(min, max)