chandlerprall / Physijs

Physics plugin for Three.js
MIT License
2.75k stars 455 forks source link

Simulate method issue #291

Open halvg opened 7 years ago

halvg commented 7 years ago

I have a question regarding simulate method. If you pass no parameters to this method this sentence is reached: while ( params.timeStep + last_simulation_duration <= fixedTimeStep ) {....} This is causing desynchronization in one test I'm doing when I simulate in client and server with different frequency. The problem is that the simulation_duration is bigger than fixedTimeStep once every two times, so step in this case is 0 and no simulation is performed. Next time simulate method is executed, the timeStep computed is calculated from the previous one, so steps are missing. If it is not the intended way of use this method, how could I have my client and server synchronized? Thanks.