Jump to content

Why should CollisionWorker save as string?


MasterK
 Share

Recommended Posts

the gulp will build work as stream of

"../../src/Collisions/babylon.collider.js",
"../../src/Collisions/babylon.collisionWorker.js",
"../../src/Collisions/babylon.collisionCoordinator.js",
"../../src/Math/babylon.math.js"

 

but in the core files, it already has

"../../src/Collisions/babylon.collider.js",

"../../src/Collisions/babylon.collisionCoordinator.js",
"../../src/Math/babylon.math.js"

 

just more about collisionCoordinator, but it's only 15K size.

in the gulp build, the min.js file is about 66K bigger than noworker.js.

 

why should the 15K worker content separated?

I think it make things complicated.

Who can explain...

Link to comment
Share on other sites

Hi,

 

I can explain!

 

The short answer - a worker requires all of its dependencies in it, as it is in another scope The collide, coordinator, and math are dependencies for both the main scope and the worker scope. it is stringified to have everything in one single file.

The longer answer - https://blog.raananweber.com/2015/05/30/web-worker-without-a-separate-file/

 

I am not too sure where it makes things complicated (and not sure to whom), But I hope this makes things a bit clearer.

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...