While upgrading my project from Three.js version 68 to version 69, I encountered an error stating
Uncaught TypeError: Cannot read property 'boundingSphere' of undefined
on line 6077 of Three.js v69:
This error pertains to a function within the THREE.Frustrum.prototype
:
intersectsObject: function () {
var sphere = new THREE.Sphere();
return function ( object ) {
var geometry = object.geometry;
if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
sphere.copy( geometry.boundingSphere );
sphere.applyMatrix4( object.matrixWorld );
return this.intersectsSphere( sphere );
};
}(),
What changes in the code should I be aware of after migrating to version 69?
The reason for transitioning from version 68 to version 69 is to utilize multiple THREE scripts for postprocessing purposes (such as THREE.EffectsComposer and others found here). Version 69 now requires the use of PlaneBufferGeometry among other things.
UPDATE: Here's the stack trace:
Uncaught TypeError: Cannot read property 'boundingSphere' of undefined Three_69_max.js:6077
(anonymous function) Three_69_max.js:6077
projectObject Three_69_max.js:21161
projectObject Three_69_max.js:21200
render Three_69_max.js:21035
animLoop.render AnimationLoop.js:161
animate MainBreederProgram.js:14
init MainBreederProgram.js:32
...
UPDATE:
Upon further examination of the call stack, it appears that the error occurs when attempting to retrieve the geometry of an Object3D
in my scene. This Object3D
contains a group of other Object3D
s and does not have its own geometry - it serves only as a container for easy access to the contained objects.