Stardew Engine
Loading...
Searching...
No Matches
Physics2D.h File Reference
#include "HandleDefs.h"
#include <cglm/cglm.h>
#include "DynArray.h"
Include dependency graph for Physics2D.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Physics2DRect
 
struct  Physics2DPoly
 
struct  Physics2DCircle
 
struct  PhysicsShape2D
 
struct  KinematicBodyOptions
 

Typedefs

typedef vec2 Physics2DPoint
 

Enumerations

enum  PhysicsBodyType { PBT_Rect , PBT_Circle , PBT_Ellipse , PBT_Poly }
 

Functions

void Ph_Init ()
 
HPhysicsWorld Ph_GetPhysicsWorld (float gravityX, float gravityY, float pixelsPerMeter)
 
void Ph_PhysicsWorldStep (HPhysicsWorld hWorld, float timestep, int substepCount)
 
void Ph_PhysicsWorldDoCollisionEvents (struct GameFrameworkLayer *pLayer)
 
void Ph_DestroyPhysicsWorld (HPhysicsWorld world)
 
void Ph_PixelCoords2PhysicsCoords (HPhysicsWorld world, vec2 inPixelCoords, vec2 outPhysicsCoords)
 
void Ph_PhysicsCoords2PixelCoords (HPhysicsWorld world, vec2 inPhysicsCoords, vec2 outPixelCoords)
 
H2DBody Ph_GetStaticBody2D (HPhysicsWorld world, struct PhysicsShape2D *pShape, struct Transform2D *pTransform, HEntity2D entity, bool bIsSensor, int entityComponentIndex, bool bGenerateSensorEvents)
 
H2DBody Ph_GetDynamicBody (HPhysicsWorld world, struct PhysicsShape2D *pShape, struct KinematicBodyOptions *pOptions, struct Transform2D *pTransform, HEntity2D entity, bool bIsSensor, int entityComponentIndex, bool bGenerateSensorEvents)
 
float Ph_GetPixelsPerMeter (HPhysicsWorld world)
 
void Ph_SetDynamicBodyVelocity (H2DBody hBody, vec2 velocity)
 
void Ph_GetDynamicBodyVelocity (H2DBody hBody, vec2 outVelocity)
 
void Ph_GetDynamicBodyPosition (H2DBody hBody, vec2 outPos)
 
void Ph_UnpackShapeUserData (void *pUserData, HEntity2D *pOutEnt, u16 *pOutCompIndex, u16 *pOutBodyType)
 
u64 Ph_PackShapeUserData (HEntity2D hEnt, u16 componentIndex, u16 bodyType)
 

Typedef Documentation

◆ Physics2DPoint

typedef vec2 Physics2DPoint

Enumeration Type Documentation

◆ PhysicsBodyType

Enumerator
PBT_Rect 
PBT_Circle 
PBT_Ellipse 
PBT_Poly 

Function Documentation

◆ Ph_DestroyPhysicsWorld()

void Ph_DestroyPhysicsWorld ( HPhysicsWorld  world)

◆ Ph_GetDynamicBody()

H2DBody Ph_GetDynamicBody ( HPhysicsWorld  world,
struct PhysicsShape2D pShape,
struct KinematicBodyOptions pOptions,
struct Transform2D pTransform,
HEntity2D  entity,
bool  bIsSensor,
int  entityComponentIndex,
bool  bGenerateSensorEvents 
)

◆ Ph_GetDynamicBodyPosition()

void Ph_GetDynamicBodyPosition ( H2DBody  hBody,
vec2  outPos 
)

◆ Ph_GetDynamicBodyVelocity()

void Ph_GetDynamicBodyVelocity ( H2DBody  hBody,
vec2  outVelocity 
)

◆ Ph_GetPhysicsWorld()

HPhysicsWorld Ph_GetPhysicsWorld ( float  gravityX,
float  gravityY,
float  pixelsPerMeter 
)

◆ Ph_GetPixelsPerMeter()

float Ph_GetPixelsPerMeter ( HPhysicsWorld  world)

◆ Ph_GetStaticBody2D()

H2DBody Ph_GetStaticBody2D ( HPhysicsWorld  world,
struct PhysicsShape2D pShape,
struct Transform2D pTransform,
HEntity2D  entity,
bool  bIsSensor,
int  entityComponentIndex,
bool  bGenerateSensorEvents 
)

◆ Ph_Init()

void Ph_Init ( )

◆ Ph_PackShapeUserData()

u64 Ph_PackShapeUserData ( HEntity2D  hEnt,
u16  componentIndex,
u16  bodyType 
)

◆ Ph_PhysicsCoords2PixelCoords()

void Ph_PhysicsCoords2PixelCoords ( HPhysicsWorld  world,
vec2  inPhysicsCoords,
vec2  outPixelCoords 
)

◆ Ph_PhysicsWorldDoCollisionEvents()

void Ph_PhysicsWorldDoCollisionEvents ( struct GameFrameworkLayer pLayer)

◆ Ph_PhysicsWorldStep()

void Ph_PhysicsWorldStep ( HPhysicsWorld  hWorld,
float  timestep,
int  substepCount 
)

◆ Ph_PixelCoords2PhysicsCoords()

void Ph_PixelCoords2PhysicsCoords ( HPhysicsWorld  world,
vec2  inPixelCoords,
vec2  outPhysicsCoords 
)

◆ Ph_SetDynamicBodyVelocity()

void Ph_SetDynamicBodyVelocity ( H2DBody  hBody,
vec2  velocity 
)

◆ Ph_UnpackShapeUserData()

void Ph_UnpackShapeUserData ( void *  pUserData,
HEntity2D pOutEnt,
u16 pOutCompIndex,
u16 pOutBodyType 
)