sandfox/simple-physics — Issue #1: Few thoughts...
Author: squarefeet
Created: 2012-02-26 19:09:44+00:00
State: open

Was going to put this in a pull req, but don't have access, and since Twitter is <= 140 xters, here I am.

This is well helpful - going to write this into my engine and see where I end up...

From what I can tell, you've decoupled the gravity calculation from actual time and pushed it to listen to your custom gametime value (determined by setInterval delay), but I'm not sure where you're using the worldTime value (in WorldManager.coffee, and how that worldTime value influences the gravity calculation (doesn't look like it does at the moment).

With my loop, I run the update loop as close to a constant 60fps (at least once every ~16ms), and when I slow down my time, the update loop gets passed a smaller value than 16ms (1.6ms, for example), but is still actually called every ~16ms. This smaller value decreases the gravity value, but also decreases the jump velocity... Argh, my head.

So using your pattern, I can use my time delta (16ms/1.6ms in slow-mo), to alter the mass of the object?