|
Stardew Engine
|
#include "Physics2D.h"#include "box2d/box2d.h"#include "ObjectPool.h"#include "Game2DLayer.h"#include "AssertLib.h"#include "GameFramework.h"#include "Entities.h"
Data Structures | |
| struct | Phys2dWorld |
| struct | Body2D |
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) |
| float | Ph_GetPixelsPerMeter (HPhysicsWorld world) |
| void | Ph_PixelCoords2PhysicsCoords (HPhysicsWorld world, vec2 inPixelCoords, vec2 outPhysicsCoords) |
| void | Ph_PhysicsCoords2PixelCoords (HPhysicsWorld world, vec2 inPhysicsCoords, vec2 outPixelCoords) |
| u64 | Ph_PackShapeUserData (HEntity2D hEnt, u16 componentIndex, u16 bodyType) |
| void | Ph_UnpackShapeUserData (void *pUserData, HEntity2D *pOutEnt, u16 *pOutCompIndex, u16 *pOutBodyType) |
| 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) |
| void | Ph_SetDynamicBodyVelocity (H2DBody hBody, vec2 velocity) |
| void | Ph_GetDynamicBodyVelocity (H2DBody hBody, vec2 outVelocity) |
| void | Ph_GetDynamicBodyPosition (H2DBody hBody, vec2 outPos) |
| 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 | ( | ) |
| 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_SetDynamicBodyVelocity | ( | H2DBody | hBody, |
| vec2 | velocity | ||
| ) |