Tag Info

Hot answers tagged

2

I was going to type up an answer, but then I found this article, which seems to be exactly what you need: http://www.iforce2d.net/b2dtut/constant-speed I'll copy a few of the relevant bits. This assumes C++, but it's certainly applicable to any language. [...] in other situations you might want it to start and stop instantaneously. It is very tempting ...


2

Part 1: Interpolation: Interpolation let's us approximate something that already happened. Multiplying "trick" (which is just math) is to mix the previous state with the current state by a certain percentage. If previous was dark and now is bright, we assume in the middle it was grey. So if for example we take a moving train. We know that right now it is ...


1

Correct me if I'm wrong, but I believe the density of fixtures will affect the mass of the body. Anyway, the only settings that affect the "bounciness" is restitution. If changing the restitution of the box doesn't fix it, have you tried changing the restitution of the ground (or whatever the box shouldn't be bouncing off of)? If that doesn't work, as far ...


1

I believe the problem is that you're assuming that the ball is at a constant speed throughout the time step. The relevent parts of your code are: ball.y += ball.y_speed * deltaTime / 1000; ball.y_speed += 1.5 * deltaTime; Unfortunately, this method only gives an approximation of the position, and this is why you are seeing errors. You are not taking into ...



Only top voted, non community-wiki answers of a minimum length are eligible