Reviewed physics module

A deeper revision required, not clear enough for the user
Key: Create a PhysicObjects pool
This commit is contained in:
raysan5
2016-02-13 17:09:53 +01:00
parent 94c92a58a1
commit ed19064405
5 changed files with 64 additions and 98 deletions

View File

@@ -466,13 +466,6 @@ typedef enum { CAMERA_CUSTOM = 0, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERS
// Collider types
typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE, COLLIDER_CAPSULE } ColliderType;
// Physics struct
typedef struct Physics {
bool enabled;
bool debug; // Should be used by programmer for testing purposes
Vector2 gravity;
} Physics;
// Transform struct
typedef struct Transform {
Vector2 position;
@@ -808,10 +801,10 @@ void SetShaderMap(Shader *shader, int mapLocation, Texture2D texture, int textur
void SetBlendMode(int mode); // Set blending mode (alpha, additive, multiplied)
//----------------------------------------------------------------------------------
// Physics System Functions (engine-module: physics)
// Physics System Functions (engine-module: physac)
//----------------------------------------------------------------------------------
void InitPhysics(void); // Initialize all internal physics values
void SetPhysics(Physics settings); // Set physics settings values using Physics data type to overwrite internal physics settings
void InitPhysics(int maxPhysicElements); // Initialize all internal physics values
void UnloadPhysics(); // Unload physic elements arrays
void AddRigidbody(int index, Rigidbody rigidbody); // Initialize a new rigidbody with parameters to internal index slot
void AddCollider(int index, Collider collider); // Initialize a new Collider with parameters to internal index slot