working physics
This commit is contained in:
65
rapier/physics.h
Normal file
65
rapier/physics.h
Normal file
@@ -0,0 +1,65 @@
|
||||
#ifndef RAPIER_H
|
||||
#define RAPIER_H
|
||||
|
||||
|
||||
|
||||
typedef enum EPhysicsBodyType {
|
||||
k_EPhysics_Static,
|
||||
k_EPhysics_Dynamic,
|
||||
k_EPhysics_KinematicPositionBased,
|
||||
k_EPhysics_KinematicVelocityBased,
|
||||
} EPhysicsBodyType;
|
||||
|
||||
typedef struct RapierCollider_t RapierCollider_t;
|
||||
|
||||
typedef struct RapierPhysicsBody_t RapierPhysicsBody_t;
|
||||
|
||||
typedef struct RapierPhysics_t RapierPhysics_t;
|
||||
|
||||
typedef struct RapierShape_t RapierShape_t;
|
||||
|
||||
typedef struct RapierWorld_t RapierWorld_t;
|
||||
|
||||
typedef struct BallShape_t {
|
||||
float m_fRadius;
|
||||
} BallShape_t;
|
||||
|
||||
typedef struct CuboidShape_t {
|
||||
float m_fExtentX;
|
||||
float m_fExtentY;
|
||||
float m_fExtentZ;
|
||||
} CuboidShape_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
void CRapierPhysicsBody_SetPosition(struct RapierPhysicsBody_t *this_,
|
||||
float fX,
|
||||
float fY,
|
||||
float fZ);
|
||||
|
||||
struct RapierPhysicsBody_t *CRapierPhysicsWorld_CreateRigidBody(struct RapierWorld_t *this_,
|
||||
struct RapierCollider_t *pCollider,
|
||||
enum EPhysicsBodyType eType);
|
||||
|
||||
void CRapierPhysicsWorld_Frame(struct RapierWorld_t *this_, float fDelta);
|
||||
|
||||
struct RapierShape_t *CRapierPhysics_CreateBall(struct RapierPhysics_t *this_,
|
||||
struct BallShape_t ball);
|
||||
|
||||
struct RapierCollider_t *CRapierPhysics_CreateCollider(struct RapierPhysics_t *this_,
|
||||
struct RapierShape_t *pShape);
|
||||
|
||||
struct RapierShape_t *CRapierPhysics_CreateCube(struct RapierPhysics_t *this_,
|
||||
struct CuboidShape_t cuboid);
|
||||
|
||||
struct RapierWorld_t *CRapierPhysics_CreateWorld(struct RapierPhysics_t *this_);
|
||||
|
||||
struct RapierPhysics_t *CRapierPhysics_New(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif /* RAPIER_H */
|
||||
Reference in New Issue
Block a user