Jump to content

[bug] mesh.simplify doesn't work when scene.workerCollisions is true


thephox1982
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...