Controls the reaction of ime::RigidBody objects when they collide. More...
#include <PhysicsIterations.h>
Public Attributes | |
unsigned int | position |
Position iterations per time-step. More... | |
unsigned int | velocity |
Velocity iterations per time-step. More... | |
Controls the reaction of ime::RigidBody objects when they collide.
When a collision is detected between two rigid bodies, a calculation is performed to resolve the collision (push the two bodies such that they no longer overlap). This calculation is performed by an iterative solver. The solver determines if and how the velocity and position of the two bodies should change. For example, when a ball hits a wall, it should as expected, bounce of the wall. A single iteration per update may not give accurate results as you may still see the ball overlap the wall. The velocity and position iterations affect the accuracy of the physics simulation.
There is a trade-off between performance and accuracy when selecting the iterations. Using fewer iterations increases performance but accuracy suffers. Likewise, using more iterations decreases performance but improves the quality the simulation simulation. You can play around with different combinations and observe how your simulations improves or degrades.
Definition at line 56 of file PhysicsIterations.h.
unsigned int ime::PhysIterations::position |
Position iterations per time-step.
Definition at line 57 of file PhysicsIterations.h.
unsigned int ime::PhysIterations::velocity |
Velocity iterations per time-step.
Definition at line 58 of file PhysicsIterations.h.