You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm assuming that passing 500ms in the deltaTime my body will get 200px moved to the right, but it does not matter if i use 1 billion ms or -1ms, it keep moving 400px exactly, so i'm interpreting that parameter badly?
Body.update(body, 16.6, 1, 1);
Body.update(body, 500, 1, 1);
The text was updated successfully, but these errors were encountered:
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 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);
The text was updated successfully, but these errors were encountered: