File Physics2D.h
FileList > engine > include > Physics2D.h
Go to the source code of this file
#include "HandleDefs.h"#include <cglm/cglm.h>#include "DynArray.h"
Classes
| Type | Name |
|---|---|
| struct | KinematicBodyOptions |
| struct | Physics2DCircle |
| struct | Physics2DPoly |
| struct | Physics2DRect |
| struct | PhysicsShape2D |
Public Types
| Type | Name |
|---|---|
| typedef vec2 | Physics2DPoint |
| enum | PhysicsBodyType |
Public Functions
| Type | Name |
|---|---|
| void | Ph_DestroyBody (H2DBody body) |
| void | Ph_DestroyPhysicsWorld (HPhysicsWorld world) |
| H2DBody | Ph_GetDynamicBody (HPhysicsWorld world, struct PhysicsShape2D * pShape, struct KinematicBodyOptions * pOptions, struct Transform2D * pTransform, HEntity2D entity, bool bIsSensor, int entityComponentIndex, bool bGenerateSensorEvents) |
| void | Ph_GetDynamicBodyPosition (H2DBody hBody, vec2 outPos) |
| void | Ph_GetDynamicBodyVelocity (H2DBody hBody, vec2 outVelocity) |
| HPhysicsWorld | Ph_GetPhysicsWorld (float gravityX, float gravityY, float pixelsPerMeter) |
| float | Ph_GetPixelsPerMeter (HPhysicsWorld world) |
| H2DBody | Ph_GetStaticBody2D (HPhysicsWorld world, struct PhysicsShape2D * pShape, struct Transform2D * pTransform, HEntity2D entity, bool bIsSensor, int entityComponentIndex, bool bGenerateSensorEvents) |
| void | Ph_Init () |
| u64 | Ph_PackShapeUserData (HEntity2D hEnt, u16 componentIndex, u16 bodyType) |
| void | Ph_PhysicsCoords2PixelCoords (HPhysicsWorld world, vec2 inPhysicsCoords, vec2 outPixelCoords) |
| void | Ph_PhysicsWorldDoCollisionEvents (struct GameFrameworkLayer * pLayer) |
| void | Ph_PhysicsWorldStep (HPhysicsWorld hWorld, float timestep, int substepCount) |
| void | Ph_PixelCoords2PhysicsCoords (HPhysicsWorld world, vec2 inPixelCoords, vec2 outPhysicsCoords) |
| void | Ph_SetDynamicBodyPosition (H2DBody hBody, vec2 inPos) |
| void | Ph_SetDynamicBodyVelocity (H2DBody hBody, vec2 velocity) |
| void | Ph_UnpackShapeUserData (void * pUserData, HEntity2D * pOutEnt, u16 * pOutCompIndex, u16 * pOutBodyType) |
Public Types Documentation
typedef Physics2DPoint
typedef vec2 Physics2DPoint;
enum PhysicsBodyType
enum PhysicsBodyType {
PBT_Rect,
PBT_Circle,
PBT_Ellipse,
PBT_Poly
};
Public Functions Documentation
function Ph_DestroyBody
void Ph_DestroyBody (
H2DBody body
)
function Ph_DestroyPhysicsWorld
void Ph_DestroyPhysicsWorld (
HPhysicsWorld world
)
function Ph_GetDynamicBody
H2DBody Ph_GetDynamicBody (
HPhysicsWorld world,
struct PhysicsShape2D * pShape,
struct KinematicBodyOptions * pOptions,
struct Transform2D * pTransform,
HEntity2D entity,
bool bIsSensor,
int entityComponentIndex,
bool bGenerateSensorEvents
)
function Ph_GetDynamicBodyPosition
void Ph_GetDynamicBodyPosition (
H2DBody hBody,
vec2 outPos
)
function Ph_GetDynamicBodyVelocity
void Ph_GetDynamicBodyVelocity (
H2DBody hBody,
vec2 outVelocity
)
function Ph_GetPhysicsWorld
HPhysicsWorld Ph_GetPhysicsWorld (
float gravityX,
float gravityY,
float pixelsPerMeter
)
function Ph_GetPixelsPerMeter
float Ph_GetPixelsPerMeter (
HPhysicsWorld world
)
function Ph_GetStaticBody2D
H2DBody Ph_GetStaticBody2D (
HPhysicsWorld world,
struct PhysicsShape2D * pShape,
struct Transform2D * pTransform,
HEntity2D entity,
bool bIsSensor,
int entityComponentIndex,
bool bGenerateSensorEvents
)
function Ph_Init
void Ph_Init ()
function Ph_PackShapeUserData
u64 Ph_PackShapeUserData (
HEntity2D hEnt,
u16 componentIndex,
u16 bodyType
)
function Ph_PhysicsCoords2PixelCoords
void Ph_PhysicsCoords2PixelCoords (
HPhysicsWorld world,
vec2 inPhysicsCoords,
vec2 outPixelCoords
)
function Ph_PhysicsWorldDoCollisionEvents
void Ph_PhysicsWorldDoCollisionEvents (
struct GameFrameworkLayer * pLayer
)
function Ph_PhysicsWorldStep
void Ph_PhysicsWorldStep (
HPhysicsWorld hWorld,
float timestep,
int substepCount
)
function Ph_PixelCoords2PhysicsCoords
void Ph_PixelCoords2PhysicsCoords (
HPhysicsWorld world,
vec2 inPixelCoords,
vec2 outPhysicsCoords
)
function Ph_SetDynamicBodyPosition
void Ph_SetDynamicBodyPosition (
H2DBody hBody,
vec2 inPos
)
function Ph_SetDynamicBodyVelocity
void Ph_SetDynamicBodyVelocity (
H2DBody hBody,
vec2 velocity
)
function Ph_UnpackShapeUserData
void Ph_UnpackShapeUserData (
void * pUserData,
HEntity2D * pOutEnt,
u16 * pOutCompIndex,
u16 * pOutBodyType
)
The documentation for this class was generated from the following file /home/runner/work/2DFarmingRPG/2DFarmingRPG/Stardew/engine/include/Physics2D.h