Clean up collider point transformations

This commit is contained in:
2023-02-19 17:16:35 +00:00
parent b4734bba37
commit c3b1988fb7
5 changed files with 75 additions and 80 deletions

View File

@@ -86,11 +86,17 @@ void gameobject_set_sensor(int id, int sensor)
gameobject_apply(id2go(id));
}
int go2id(struct gameobject *go)
{
id_from_gameobject(go);
}
void go_shape_apply(cpBody *body, cpShape *shape, struct gameobject *go)
{
cpShapeSetFriction(shape, go->f);
cpShapeSetElasticity(shape, go->e);
cpShapeSetSensor(shape, go->sensor);
cpShapeSetCollisionType(shape, go2id(go));
if (go->sensor)
YughInfo("Enabled a sensor ...");
// cpShapeSetFilter(shape, go->filter);