Closed nosenfield closed 5 years ago
Ok, figured out the problem in my understanding. Velocity is provided on a per step, not per second basis. If i adjust the above to factor in the conversion of stepsPerSecond (100 / 16.666) then it works out.
Exactly, that's correct as of the current version but I am working on an update that provides new Body getter and setter functions that handle this, sorry it isn't all that clear at the moment.
No worries. I think some added documentation is all you'd need to clear it up. And in the meantime, hopefully this ticket will help.
I have a project where the user creates a parabola to represent the path of a projectile and then can launch a projectile along that curve. I've attempted to reverse engineer the velocity from the parabola, but am running into an issue where the render for projectile doesn't match up with the curve. And when I plug the numbers into the standard motion equations they make no sense.
I created a test project with a projectile and the ground using:
Then I launch the ball using:
The collisionStart listener reports the position of the ball as: 25, 90. My understanding is that matterjs uses meters, kilograms, and seconds. If I plug these numbers into the motion equations I get: ∆x = .5at² 90 = .5 9.8 t² 4.3 = t
v = d/t v = 25 / 4.3 v = 5.8
Why does a velocity of 1 translate to a velocity of 5.8 when subbing in actual units? Is there some kind of actual conversion scale I can use?