Hi, I'm currently using this.clock.setInterval
to compute some time based positions.
For that task I need the deltaTime within the interval scope (not the room.setSimulationInterval
scope).
Right now I'm computing the deltaTime on my own:
var timestamp = this.clock.currentTime;
this.clock.setInterval(function() {
const delta = this.clock.currentTime - timestamp;
//event tough refresh rate is set to 2000, the deltaTime is between about 1983 and 2013
[...] //code
timestamp = this.clock.currentTime;
}, 2000);
It would be nice to get the local deltaTime passed in by the setInterval closure just like in room.setSimulationInterval
:
this.clock.setInterval(function(**deltaTime**) {
[...] //code
}, 2000);
Are there any other suggestions how to get the deltaTime within a local setInterval
?