From 1a8d05b8b4489cd31ff9fb1801e8e0b4fae0acff Mon Sep 17 00:00:00 2001 From: bjorn Date: Fri, 5 Apr 2024 18:44:04 -0700 Subject: [PATCH] newCollider takes optional Shape as first arg; --- src/api/l_physics_world.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api/l_physics_world.c b/src/api/l_physics_world.c index 99c16067..dc551ecf 100644 --- a/src/api/l_physics_world.c +++ b/src/api/l_physics_world.c @@ -102,9 +102,10 @@ static bool queryCallback(Collider* collider, uint32_t shape, void* userdata) { static int l_lovrWorldNewCollider(lua_State* L) { World* world = luax_checktype(L, 1, World); + Shape* shape = luax_totype(L, 2, Shape); float position[3]; - luax_readvec3(L, 2, position, NULL); - Collider* collider = lovrColliderCreate(world, NULL, position[0], position[1], position[2]); + luax_readvec3(L, 2 + !!shape, position, NULL); + Collider* collider = lovrColliderCreate(world, shape, position[0], position[1], position[2]); luax_pushtype(L, Collider, collider); lovrRelease(collider, lovrColliderDestroy); return 1;