Tag Info

Hot answers tagged

5

It's very probable that Erin Cato subtly justified the use of the Symplectic Euler over RK4 or another higher order integrator. The author has lots of slides and/or material (e.g. http://gamedevs.org/uploads/numerical-integration.pdf) related to the inner workings of the Box2D engine. The main reasons for why RK4 is not really needed when writing this kind ...


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 ...


2

While I can't speak for Erin Catto himself, the simple answer is that in many games-related physics systems a standard Euler method is preferred to a Runge-Kutta method because it is less expensive computationally, while also being sufficiently stable for games in general. If RK4 was used the integrator would become a larger bottleneck, impacting the ...


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 ...


1

I wonder if chopmunk allows the object to be made static inside a callback issued from the guts of the physics engine. What if you set a flag on the object and after updating physics you set things static? It would be worth checking the documentation on cpSpaceRemoveBody. I looked into the source code for chipmunk, and here's the relevant function: void ...


1

First of all, if you want to avoid aliasing problems, you need to respect the Shannon rule. So you need to take 120FPS or more. Secondly, you don't really need to care, you can simulate at 40 if you want, just be sure to linearly interpolate all of your matrices, the frame presentation time is the t, and your physics simulation always have to run some ...



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