Commit Graph

20 Commits

Author SHA1 Message Date
victorfisac
5a1cbb2842 Fix current time value 2016-06-14 20:25:08 +02:00
victorfisac
54537e8f0b Fixed bug in delta time calculation...
and added PHYSAC_NO_THREADS define. Improved physac example drawing
frames per second in screen.
2016-06-14 20:23:46 +02:00
victorfisac
5625c11e99 Added internal hi-resolution timer to physac...
... 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.
2016-06-12 22:07:06 +02:00
victorfisac
c10c49e44f Convert physac module from static steps to fixed time steps
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.
2016-06-11 18:35:46 +02:00
raysan5
c46c0fc652 Corrected keywords usage 2016-06-11 12:18:08 +02:00
raysan5
e2cfc6b838 Reduced physic steps resolution 2016-06-09 21:00:21 +02:00
raysan5
558ec3891b Converted physac module to header only 2016-06-09 20:01:59 +02:00
raysan5
2168d8aa1a Removed DrawPhysicObjectInfo() function
To avoid additional dependencies
2016-06-02 19:16:11 +02:00
raysan5
af890cf210 Updated to avoid pointers 2016-05-20 10:53:58 +02:00
victorfisac
60223a358b Physac redesign (3/3)
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.
2016-03-23 15:50:41 +01:00
victorfisac
0caf925d5d Updated headers 2016-03-16 12:48:30 +01:00
victorfisac
7128ef686d physac module redesign (2/3)
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.
2016-03-16 12:45:01 +01:00
victorfisac
78e4772f21 Fixed physac header little mistake 2016-03-05 19:36:40 +01:00
victorfisac
305efcf5ad Redesigned physics module (IN PROGRESS)
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.
2016-03-05 17:05:02 +01:00
raysan5
ed19064405 Reviewed physics module
A deeper revision required, not clear enough for the user
Key: Create a PhysicObjects pool
2016-02-13 17:09:53 +01:00
raysan5
cf6c6fefd7 Review some function names for consistency with raymath 2016-01-20 19:23:58 +01:00
raysan5
c5663ca015 Some formatting tweaks 2016-01-20 19:09:48 +01:00
victorfisac
fe0cf8f9a9 Added some comments and fixed spaces 2016-01-05 13:58:20 +01:00
victorfisac
a299bc289b Improved and added functions to physac engine module
- Improved physics calculations.
- Added AddForceAtPosition function (added to all enabled rigidbodies).
- Updated raylib header.
2016-01-03 17:53:29 +01:00
Ray
59cf0f6a42 Update and rename physics.h to physac.h 2015-12-30 13:42:59 +01:00