does it work for real? i do everything right i think i stop scene.simulation() in rendering with boolean and resuming it calling together scene.onsimulationresume()
first i have global variable isPaused = false;
second im stopping simulation with my keydown event
case 32:
if(!isPaused) { isPaused = true; }
else { isPaused = false; scene.onSimulationResume(); }
break;
and my rendering
function animate()
{
requestAnimationFrame(animate);
if (!isPaused) { scene.simulate(); document.getElementById("footer").innerHTML= "Running.."; }
else { document.getElementById("footer").innerHTML= "Stopped.."; }
renderer.render(scene, camera);
loop();
}
and physics of my nonstatic object stops but when i resume i can see the object was moving while it was stopped
does it work for real? i do everything right i think i stop scene.simulation() in rendering with boolean and resuming it calling together scene.onsimulationresume()
first i have global variable isPaused = false; second im stopping simulation with my keydown event case 32: if(!isPaused) { isPaused = true; } else { isPaused = false; scene.onSimulationResume(); } break;
and my rendering
function animate() { requestAnimationFrame(animate); if (!isPaused) { scene.simulate(); document.getElementById("footer").innerHTML= "Running.."; } else { document.getElementById("footer").innerHTML= "Stopped.."; } renderer.render(scene, camera); loop(); }
and physics of my nonstatic object stops but when i resume i can see the object was moving while it was stopped