Open Andrek25 opened 1 year ago
Up to and including the release 0.18.0
velocity and speed units are (effectively) pixels per deltaTime ms
which I think is what you're seeing, for these versions: normalise the result if not using a fixed deltaTime
.
Note: this is due to become built in among other changes as part of #777 so please track that and keep an eye on release notes.
Sorry i don't get it 😅
If the movement is effectvely why the deltaTime
literally do anything:
// If i'm passing a higher number in the `deltaTime` parameter.
console.log(Number.MAX_SAFE_INTEGER); // => 9007199254740991
// WHY this is moving the body how it's running at `1000 / 60`?
Body.update(circle, Number.MAX_SAFE_INTEGER, 1.0, 1.0);
So i don't understand why MatterJS
is fixing internally the deltaTime
or whatever is happening with the Verlet integration.
Maybe i need to use Engine.update
but i just want to move a body that was in the past to the present, so i need to simulate it for a higher deltaTime
and i don't want to call multiple times the update
function in 1 tick, can you help me with a simple example of this if it's not hard please 🙏🏻.
I'm not quite sure but worth trying out the latest release 0.19.0
as that includes #777, which has some changes related to this topic that might help.
I'm doing this:
I'm assuming that passing
500ms
in thedeltaTime
my body will get200px
moved to the right, but it does not matter if i use1 billion ms
or-1ms
, it keep moving400px
exactly, so i'm interpreting that parameter badly?Body.update(body, 16.6, 1, 1);
Body.update(body, 500, 1, 1);