This commit is contained in:
bjorn 2017-05-16 12:24:49 -06:00
parent c7515a1f7e
commit bca3335da8
2 changed files with 7 additions and 5 deletions

View File

@ -265,6 +265,12 @@ World* lovrBodyGetWorld(Body* body) {
return body->world;
}
void lovrShapeDestroy(const Ref* ref) {
Shape* shape = containerof(ref, Shape);
dGeomDestroy(shape->id);
free(shape);
}
ShapeType lovrShapeGetType(Shape* shape) {
return shape->type;
}
@ -278,8 +284,4 @@ void lovrShapeSetBody(Shape* shape, Body* body) {
dGeomSetBody(shape->id, body ? body->id : 0);
}
void lovrShapeDestroy(const Ref* ref) {
Shape* shape = containerof(ref, Shape);
dGeomDestroy(shape->id);
free(shape);
}

View File

@ -74,7 +74,7 @@ void* lovrBodyGetUserData(Body* body);
void lovrBodySetUserData(Body* body, void* data);
World* lovrBodyGetWorld(Body* body);
void lovrShapeDestroy(const Ref* ref);
ShapeType lovrShapeGetType(Shape* shape);
Body* lovrShapeGetBody(Shape* shape);
void lovrShapeSetBody(Shape* shape, Body* body);
void lovrShapeDestroy(const Ref* ref);