Skip to content

Commit

Permalink
feat(utils/pointToBox): halve size parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
meszaros-lajos-gyorgy committed Dec 20, 2023
1 parent 4b4fd7d commit e19ce0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e19ce0c

Please sign in to comment.