Warnings in console THREE.Box3: .... target is now required

Hi, I have updated version of three.js (was 0.87.0)

And now I have these warnings in console:

three.module.js:5602 THREE.Box3: .getBoundingSphere() target is now required
three.module.js:5246 THREE.Box3: .getCenter() target is now required
three.module.js:5259 THREE.Box3: .getSize() target is now required

Didn’t find any information in release notes or upgrade guides.

Use them as (just an example):

model.geometry.computeBoundingBox();
const bBox = model.geometry.boundingBox;
const bSphere = bBox.getBoundingSphere();
const center = bBox.getCenter();
const size = bBox.getSize()

So I’m not sure what I need to provide as a target.

1 Like

From the migration guide r90 → r91:

optionalTargets are now mandatory method parameters (with exception of curve classes).

You do this now:

const center = new THREE.Vector3();
bBox.getCenter( center );
5 Likes

Whole story:

3 Likes