From 420dfc0edccf2019ea5d37b9f86d867b794d4fd6 Mon Sep 17 00:00:00 2001 From: polygonboutique Date: Mon, 21 Nov 2016 08:40:43 +0100 Subject: [PATCH] height maps --- src/game-lib-world.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/game-lib-world.js b/src/game-lib-world.js index 76eb306..07896d8 100644 --- a/src/game-lib-world.js +++ b/src/game-lib-world.js @@ -109,24 +109,18 @@ GameLib.D3.World.prototype.step = function( this.instance.step(fixedStep, dtStep, 3); return; - - // todo: figure out, why this call to internal step is more stable for trimesh collisions..... - //this.instance.internalStep(timeStep); - //return; - //console.log("this should not be called."); - - //var now = Date.now() / 1000; - var now = null; + var now = Date.now() / 1000.0; + //var now = null; if(!this.lastCallTime){ // last call time not saved, cant guess elapsed time. Take a simple step. - this.instance.step(timeStep); + this.instance.step(fixedStep); this.lastCallTime = now; return; } - var timeSinceLastCall = now - this.lastCallTime; + var timeSinceLastCall = (now - this.lastCallTime); - this.instance.step(timeStep, timeSinceLastCall); + this.instance.step(fixedStep, timeSinceLastCall, 4); this.lastCallTime = now; };