JBP Posted November 7, 2016 Share Posted November 7, 2016 Hello, can anyone tell me if the current implementation of the Physics engines (oimo, cannon) support Web Worker or its a single thread implementation ? Quote Link to comment Share on other sites More sharing options...
tips4design Posted November 7, 2016 Share Posted November 7, 2016 It's usually not worth running your physics in a separate Web Worker if you need to access the state of the world each frame, as reading/transferring data from the worker thread is costly and doing it each frame might be slow. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 7, 2016 Share Posted November 7, 2016 Yes since version 2.1 Workers is supported for the Physics engines (oimo and cannon) : Tutorial: https://blog.raananweber.com/2015/05/26/collisions-using-workers-for-babylonjs/ To enable it to do: scene.workerCollisions = true; ian 1 Quote Link to comment Share on other sites More sharing options...
ian Posted November 7, 2016 Share Posted November 7, 2016 SetTimeStep 1/10 on phone with WebView Works smooth as 1/50 on desktop !!! Accuracy of physics work same. I verified this on My Project Perplexus. I have WebView for Android perplexus Project and with 1/10 It Works brilliant. On desktop It Works as fast as Real Perplexus If you ever try this Game. Try experiment on different devices with setTimeStep 1/10 or 1/5 for slower devices. Quote Link to comment Share on other sites More sharing options...
JBP Posted November 7, 2016 Author Share Posted November 7, 2016 7 minutes ago, Dad72 said: Yes since version 2.1 Workers is supported for the Physics engines (oimo and cannon) : Tutorial: https://blog.raananweber.com/2015/05/26/collisions-using-workers-for-babylonjs/ To enable it to do: scene.workerCollisions = true; Hello, but this if for the build in collisions right ? I asking for the oimo or cannon plug-in is the "world.step()" function called inside a Worker ? Quote Link to comment Share on other sites More sharing options...
ian Posted November 7, 2016 Share Posted November 7, 2016 http://www.babylonjs-playground.com/#2B84TV#2 Here is example of setTimeStep for physics. I did also as Dad72 say. But default 1/50 Works slow. The Real speed was when I add slider gui setings for setTimeStep. SetTimeStep is realy qul staff for slow phones WebView beleave me. If you dont try it JBP 1 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.