Wednesday, June 3, 2015

What is a "solver" in a physics engine?


I am self-taught and have successfully coded simple collisions of planes, spheres, rays and up until interactive cloth simulations so I do have some basic sense of which part of the physics goes where in code; but no idea of the terminologies.



It's the jargon that I do not understand: What is a physics solver? How does a solver look like in code or which part of the engine is considered a solver?


For example what does the phrase "Box2d is using iterative solver" mean?



Answer



Generally physics engines are split into two major parts: Collision detection and collision resolution. The solver is just responsible for the second part.


After your collision detection part determines which pairs of objects collide, and where, the solver is responsible for creating the correct physical response.


"Iterative solver" just means that the solver uses an iterative method to calculate those responses. It's iterative because you can, for various reasons, not calculate a completely physically accurate response in physics engines. Therefor these engines perform certain approximations (via numerical integration) to the correct physical response.


These approximations are done more than once per simulation frame (hence, "iterative") since it generally gets more accurate the more iterations of these approximations you have.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...