-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library needs to be updated to latest ThreeJS version #19
Comments
Line 2085 is https://github.com/collinhover/threeoctree/blob/master/threeoctree.js#L2085. Are you sure you're using the latest version? /ping @Wilt you're the most familiar with the latest THREE + Octree, any thoughts? |
Mine is also "threeoctree.js (r60)" so I assume I am. I did copy the raw file text and paste it into a new js file though (as opposed to downloading it), so maybe some things in the ifle we're moved around when I did that. In the file you linked, the line I changed was 2150. |
The fix needs to check for intersections on the THREE object. I believe this line is the problem: https://github.com/collinhover/threeoctree/blob/master/threeoctree.js#L2158. Internally THREE must have changed how the geometry/faces are accessed on an object. |
Probably you have a buffer geometry and buffer geometries don't have faces. |
I was working on adding support for buffer geometries but I have lots of other work waiting for me... |
I am using buffered geometry, you're right. In the meantime hopefully people will see my hacky fix and use that. |
Getting the error: "Octree.js:2094 Uncaught TypeError: Cannot read property 'faces' of undefined".
I'm pretty sure this is because the library is out of date.
My temporary fix (to help anyone else affected by this) is to change line 2085 to be:
if ( object.object instanceof THREE.Object3D ) { return this.intersectOctreeObject(object.object, recursive);
The "return this.intersectOctreeObject" forces it to keep recursing until it finds the type of non-octree object it's looking for.
Anyways, thought I'd let you know. I'd also like an updated version of the library in case I run into some weird edge cases in the future.
The text was updated successfully, but these errors were encountered: