This commit is contained in:
2023-02-13 14:30:35 +00:00
parent 8155bddb5e
commit fceb68a910
10 changed files with 88 additions and 10 deletions

View File

@@ -38,6 +38,16 @@ int body2id(cpBody *body)
return cpBodyGetUserData(body);
}
cpBody *id2body(int id)
{
struct gameobject *go;
if (go = id2go(id))
return go->body;
return NULL;
}
int shape2gameobject(cpShape *shape)
{
struct phys2d_shape *s = cpShapeGetUserData(shape);