... and now physac thread creation is done in InitPhysics() and it is
destroyed in ClosePhysics(). User just need to call these functions to
use physac module.
Old physics update system used a static number of steps to calculate
physics (450 for desktop and 64 for android). It was too much and it was
limited by target frame time...
Now physics update runs in a secondary thread using a fixed delta time
value to update steps. Collisions are perfectly detected and resolved
and performance has been improved so much.
Finally, physics update is handled in main thread using steps to get
accuracy in collisions detection instead of moving it to a new thread.
Examples are finished as simple and clear as I could. Finally, physac
module is MORE simpler than in the first version, calculation everything
by the same way for both types of physic objects.
I tryed to add rotated physics a couple of times but I didn't get
anything good to get a base to improve it. Maybe for the next version...
No bugs or strange behaviours found during testing.
physac module base almost finished. All collisions are now resolved
properly and some force functions was added.
COLLIDER_CAPSULE removed for now because in 2D everything is composed by
rectangle and circle colliders...
The last step is move physics update loop into another thread and update
it in a fixed time step based on fps.
physac modules is being redesigned. Physics base behaviour is done and
it is composed by three steps: apply physics, resolve collisions and fix
overlapping.
A basic example is currently in progress. The next steps are try to add
torque and unoriented physic collisions and implement physics basic
functions to add forces. Rigidbody grounding state is automatically
calculated and has a perfect result. Rigidbodies interacts well with
each others.
To achieve physics accuracy, UpdatePhysics() is called a number of times
per frame. In a future, it should be changed to another thread and call
it without any target frame restriction.
Basic physics example has been redone (not finished) using the new
module functions. Forces examples will be redone so I removed it from
branch.