mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
Merge pull request #3177 from Barnold1953/OculusSDK
Use deltaTIme to ensure sand updates are somewhat uniform
This commit is contained in:
commit
cc7da35722
1 changed files with 10 additions and 1 deletions
|
@ -446,8 +446,17 @@ var numAdjacentVoxels = 0;
|
|||
//Stores a list of voxels we need to activate
|
||||
var activateMap = {};
|
||||
|
||||
function update() {
|
||||
var UPDATES_PER_SECOND = 12.0; // frames per second
|
||||
var frameIndex = 0.0;
|
||||
var oldFrameIndex = 0;
|
||||
|
||||
function update(deltaTime) {
|
||||
frameIndex += deltaTime * UPDATES_PER_SECOND;
|
||||
if (Math.floor(frameIndex) == oldFrameIndex) {
|
||||
return;
|
||||
}
|
||||
oldFrameIndex++;
|
||||
|
||||
//Clear the activate map each frame
|
||||
activateMap = {};
|
||||
|
||||
|
|
Loading…
Reference in a new issue