Skip to content
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

Open
kujukuju opened this issue Oct 10, 2016 · 6 comments
Open

Library needs to be updated to latest ThreeJS version #19

kujukuju opened this issue Oct 10, 2016 · 6 comments

Comments

@kujukuju
Copy link

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.

@collinhover
Copy link
Owner

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?

@kujukuju
Copy link
Author

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.

@collinhover
Copy link
Owner

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.

@Wilt
Copy link
Contributor

Wilt commented Oct 27, 2016

Probably you have a buffer geometry and buffer geometries don't have faces.

@Wilt
Copy link
Contributor

Wilt commented Oct 27, 2016

I was working on adding support for buffer geometries but I have lots of other work waiting for me...

@kujukuju
Copy link
Author

I am using buffered geometry, you're right. In the meantime hopefully people will see my hacky fix and use that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants