Updated headers
This commit is contained in:
parent
dc68205a18
commit
0caf925d5d
2 changed files with 10 additions and 7 deletions
|
@ -62,8 +62,8 @@ typedef struct Rigidbody {
|
||||||
typedef struct Collider {
|
typedef struct Collider {
|
||||||
bool enabled;
|
bool enabled;
|
||||||
ColliderType type;
|
ColliderType type;
|
||||||
Rectangle bounds; // Used for COLLIDER_RECTANGLE and COLLIDER_CAPSULE
|
Rectangle bounds; // Used for COLLIDER_RECTANGLE
|
||||||
int radius; // Used for COLLIDER_CIRCLE and COLLIDER_CAPSULE
|
int radius; // Used for COLLIDER_CIRCLE
|
||||||
} Collider;
|
} Collider;
|
||||||
|
|
||||||
typedef struct PhysicObject {
|
typedef struct PhysicObject {
|
||||||
|
|
13
src/raylib.h
13
src/raylib.h
|
@ -466,7 +466,7 @@ typedef struct {
|
||||||
// Camera system modes
|
// Camera system modes
|
||||||
typedef enum { CAMERA_CUSTOM = 0, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON } CameraMode;
|
typedef enum { CAMERA_CUSTOM = 0, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON } CameraMode;
|
||||||
|
|
||||||
typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE, COLLIDER_CAPSULE } ColliderType;
|
typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE } ColliderType;
|
||||||
|
|
||||||
typedef struct Transform {
|
typedef struct Transform {
|
||||||
Vector2 position;
|
Vector2 position;
|
||||||
|
@ -482,14 +482,14 @@ typedef struct Rigidbody {
|
||||||
bool applyGravity;
|
bool applyGravity;
|
||||||
bool isGrounded;
|
bool isGrounded;
|
||||||
float friction; // Normalized value
|
float friction; // Normalized value
|
||||||
float bounciness; // Normalized value
|
float bounciness;
|
||||||
} Rigidbody;
|
} Rigidbody;
|
||||||
|
|
||||||
typedef struct Collider {
|
typedef struct Collider {
|
||||||
bool enabled;
|
bool enabled;
|
||||||
ColliderType type;
|
ColliderType type;
|
||||||
Rectangle bounds; // Used for COLLIDER_RECTANGLE and COLLIDER_CAPSULE
|
Rectangle bounds; // Used for COLLIDER_RECTANGLE
|
||||||
int radius; // Used for COLLIDER_CIRCLE and COLLIDER_CAPSULE
|
int radius; // Used for COLLIDER_CIRCLE
|
||||||
} Collider;
|
} Collider;
|
||||||
|
|
||||||
typedef struct PhysicObject {
|
typedef struct PhysicObject {
|
||||||
|
@ -810,13 +810,16 @@ void SetBlendMode(int mode); // Set blend
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Physics System Functions (Module: physac)
|
// Physics System Functions (Module: physac)
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
void InitPhysics(); // Initializes pointers array (just pointers, fixed size)
|
void InitPhysics(Vector2 gravity); // Initializes pointers array (just pointers, fixed size)
|
||||||
void UpdatePhysics(); // Update physic objects, calculating physic behaviours and collisions detection
|
void UpdatePhysics(); // Update physic objects, calculating physic behaviours and collisions detection
|
||||||
void ClosePhysics(); // Unitialize all physic objects and empty the objects pool
|
void ClosePhysics(); // Unitialize all physic objects and empty the objects pool
|
||||||
|
|
||||||
PhysicObject *CreatePhysicObject(Vector2 position, float rotation, Vector2 scale); // Create a new physic object dinamically, initialize it and add to pool
|
PhysicObject *CreatePhysicObject(Vector2 position, float rotation, Vector2 scale); // Create a new physic object dinamically, initialize it and add to pool
|
||||||
void DestroyPhysicObject(PhysicObject *pObj); // Destroy a specific physic object and take it out of the list
|
void DestroyPhysicObject(PhysicObject *pObj); // Destroy a specific physic object and take it out of the list
|
||||||
|
|
||||||
|
void ApplyForce(PhysicObject *pObj, Vector2 force); // Apply directional force to a physic object
|
||||||
|
void ApplyForceAtPosition(Vector2 position, float force, float radius); // Apply radial force to all physic objects in range
|
||||||
|
|
||||||
Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale)
|
Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale)
|
||||||
void DrawPhysicObjectInfo(PhysicObject *pObj, Vector2 position, int fontSize); // Draw physic object information at screen position
|
void DrawPhysicObjectInfo(PhysicObject *pObj, Vector2 position, int fontSize); // Draw physic object information at screen position
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue