aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-01-20 19:09:48 +0100
committerraysan5 <raysan5@gmail.com>2016-01-20 19:09:48 +0100
commitc5663ca015e550ab8e2a43c10fa72db0aab7cac8 (patch)
tree17b31aadd4694efd35240dc0b7412109c921c38f /src
parent51c0b61a432e424c04b32800c98b064c34b01153 (diff)
downloadraylib-c5663ca015e550ab8e2a43c10fa72db0aab7cac8.tar.gz
raylib-c5663ca015e550ab8e2a43c10fa72db0aab7cac8.zip
Some formatting tweaks
Diffstat (limited to 'src')
-rw-r--r--src/physac.c6
-rw-r--r--src/physac.h3
-rw-r--r--src/raylib.h8
3 files changed, 9 insertions, 8 deletions
diff --git a/src/physac.c b/src/physac.c
index 6e3b6e61..6dfdbb49 100644
--- a/src/physac.c
+++ b/src/physac.c
@@ -183,9 +183,9 @@ void ApplyPhysics(int index, Vector2 *position)
{
if (colliders[index].enabled && colliders[j].enabled)
{
- if (colliders[index].type == RectangleCollider)
+ if (colliders[index].type == COLLIDER_RECTANGLE)
{
- if (colliders[j].type == RectangleCollider)
+ if (colliders[j].type == COLLIDER_RECTANGLE)
{
if (CheckCollisionRecs(colliders[index].bounds, colliders[j].bounds))
{
@@ -207,7 +207,7 @@ void ApplyPhysics(int index, Vector2 *position)
}
else
{
- if (colliders[j].type == RectangleCollider)
+ if (colliders[j].type == COLLIDER_RECTANGLE)
{
if (CheckCollisionCircleRec((Vector2){colliders[index].bounds.x, colliders[index].bounds.y}, colliders[index].radius, colliders[j].bounds))
{
diff --git a/src/physac.h b/src/physac.h
index 558673ef..a1501ee3 100644
--- a/src/physac.h
+++ b/src/physac.h
@@ -32,7 +32,8 @@
//----------------------------------------------------------------------------------
// Types and Structures Definition
//----------------------------------------------------------------------------------
-typedef enum { RectangleCollider, CircleCollider } ColliderType;
+// Collider types
+typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE, COLLIDER_CAPSULE } ColliderType;
// Physics struct
typedef struct Physics {
diff --git a/src/raylib.h b/src/raylib.h
index 0a768fe4..5798d907 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -463,12 +463,12 @@ typedef struct {
typedef enum { CAMERA_CUSTOM = 0, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON } CameraMode;
// Collider types
-typedef enum { RectangleCollider, CircleCollider } ColliderType;
+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
+ bool debug; // Should be used by programmer for testing purposes
Vector2 gravity;
} Physics;
@@ -496,8 +496,8 @@ typedef struct Rigidbody {
typedef struct Collider {
bool enabled;
ColliderType type;
- Rectangle bounds; // Just used for RectangleCollider type
- int radius; // Just used for CircleCollider type
+ Rectangle bounds; // Used for COLLIDER_RECTANGLE and COLLIDER_CAPSULE
+ int radius; // Used for COLLIDER_CIRCLE and COLLIDER_CAPSULE
} Collider;
#ifdef __cplusplus