thephox1982 Posted October 15, 2015 Share Posted October 15, 2015 I was trying to figure out why I was getting a javascript error when I added auto lod to my scene, no matter what mesh I used, even simple sphere like in demo for the simplification auto lod system, the error was: Uncaught TypeError: Cannot read property 'position' of undefinedbabylon.2.2.max.js:29038 Geometry.getVertexBufferbabylon.2.2.max.js:29017 Geometry.getVerticesDatababylon.2.2.max.js:9812 CollisionCoordinatorWorker.SerializeGeometrybabylon.2.2.max.js:9635 CollisionCoordinatorWorker.onGeometryUpdatedbabylon.2.2.max.js:9765 CollisionCoordinatorWorker.onGeometryAddedbabylon.2.2.max.js:13320 Scene.pushGeometrybabylon.2.2.max.js:29145 Geometry.applyToMeshbabylon.2.2.max.js:28934 Geometrybabylon.2.2.max.js:15124 Mesh.setIndicesbabylon.2.2.max.js:32330 QuadraticErrorSimplification.reconstructMeshbabylon.2.2.max.js:32185 (anonymous function) So I went through process of elimination and finally found it had to do with physics and then I found it wasn't the physics engine I was using but the command: scene.workerCollisions = true; As long as that one line is commented out auto lod works fine!This isn't a big upset yet, but I will like to take advantage of the workerCollisions at some point, but for now can just leave it off. To replicate this, simply enable basic collisions in any demo and add workerCollisions and then try the auto lod. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 16, 2015 Share Posted October 16, 2015 Raanan, the master mind behind workers, will be soon with you Quote Link to comment Share on other sites More sharing options...
RaananW Posted October 16, 2015 Share Posted October 16, 2015 Well, that's an interesting clash :-)Let's smash that bug. Is there any way you can share a playground?Just to make sure I understand the bug - when you are using both features - auto lod and worker collisions, the bug appears. I can see it happens after simplification, I believe I have an idea how to solve this. But a playground would be wonderful. Quote Link to comment Share on other sites More sharing options...
RaananW Posted October 16, 2015 Share Posted October 16, 2015 I believe I found the reason it happens. Just pushed a change - https://github.com/BabylonJS/Babylon.js/pull/759 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.