assaultfish/engine/src/physics.c

36 lines
684 B
C
Raw Normal View History

2026-01-31 09:29:13 +09:00
#include <GearSrc/Physics.h>
#include <GearSrc/Log.h>
#include <ode/ode.h>
2026-02-01 00:22:34 +09:00
void GSPhysicsInit(void) {
2026-01-31 09:29:13 +09:00
dInitODE2(0);
}
2026-02-01 00:22:34 +09:00
GSPhysics GSPhysicsCreate(GSServer server) {
GSPhysics physics = malloc(sizeof(*physics));
memset(physics, 0, sizeof(*physics));
physics->engine = server->engine;
physics->world = dWorldCreate();
physics->space = dSimpleSpaceCreate(0);
GSLog(server->engine, GSLogInfo, "Created physics engine");
return physics;
}
void GSPhysicsDestroy(GSPhysics physics) {
dSpaceDestroy(physics->space);
dWorldDestroy(physics->world);
GSLog(physics->engine, GSLogInfo, "Destroyed physics engine");
free(physics);
}
void GSPhysicsStep(GSPhysics physics) {
}