Skip to content

Commit

Permalink
Rename World:collide to :collideShape;
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornbytes committed Apr 30, 2024
1 parent 186a085 commit a8f8f15
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/api/l_physics_world.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ static int l_lovrWorldShapecast(lua_State* L) {
return 0;
}

static int l_lovrWorldCollide(lua_State* L) {
static int l_lovrWorldCollideShape(lua_State* L) {
World* world = luax_checktype(L, 1, World);
int index;
Shape* shape;
Expand All @@ -320,13 +320,13 @@ static int l_lovrWorldCollide(lua_State* L) {
uint32_t filter = luax_checktagmask(L, index++, world);
if (lua_isnoneornil(L, index)) {
CollideResult hit;
if (lovrWorldCollide(world, shape, pose, scale, filter, collideFirstCallback, &hit)) {
if (lovrWorldCollideShape(world, shape, pose, scale, filter, collideFirstCallback, &hit)) {
return luax_pushcollideresult(L, &hit);
}
} else {
luaL_checktype(L, index, LUA_TFUNCTION);
lua_settop(L, index);
lovrWorldCollide(world, shape, pose, scale, filter, collideCallback, L);
lovrWorldCollideShape(world, shape, pose, scale, filter, collideCallback, L);
}
return 0;
}
Expand Down Expand Up @@ -505,7 +505,7 @@ const luaL_Reg lovrWorld[] = {
{ "update", l_lovrWorldUpdate },
{ "raycast", l_lovrWorldRaycast },
{ "shapecast", l_lovrWorldShapecast },
{ "collide", l_lovrWorldCollide },
{ "collideShape", l_lovrWorldCollideShape },
{ "queryBox", l_lovrWorldQueryBox },
{ "querySphere", l_lovrWorldQuerySphere },
{ "getGravity", l_lovrWorldGetGravity },
Expand Down
2 changes: 1 addition & 1 deletion src/modules/physics/physics.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void lovrWorldSetGravity(World* world, float gravity[3]);
void lovrWorldUpdate(World* world, float dt);
bool lovrWorldRaycast(World* world, float start[3], float end[3], uint32_t filter, CastCallback* callback, void* userdata);
bool lovrWorldShapecast(World* world, Shape* shape, float pose[7], float scale, float end[3], uint32_t filter, CastCallback* callback, void* userdata);
bool lovrWorldCollide(World* world, Shape* shape, float pose[7], float scale, uint32_t filter, CollideCallback* callback, void* userdata);
bool lovrWorldCollideShape(World* world, Shape* shape, float pose[7], float scale, uint32_t filter, CollideCallback* callback, void* userdata);
bool lovrWorldQueryBox(World* world, float position[3], float size[3], uint32_t filter, QueryCallback* callback, void* userdata);
bool lovrWorldQuerySphere(World* world, float position[3], float radius, uint32_t filter, QueryCallback* callback, void* userdata);
void lovrWorldDisableCollisionBetween(World* world, const char* tag1, const char* tag2);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/physics/physics_jolt.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ static float collideCallback(void* arg, JPH_CollideShapeResult* result) {
return ctx->callback(ctx->userdata, &hit);
}

bool lovrWorldCollide(World* world, Shape* shape, float pose[7], float scale, uint32_t filter, CollideCallback* callback, void* userdata) {
bool lovrWorldCollideShape(World* world, Shape* shape, float pose[7], float scale, uint32_t filter, CollideCallback* callback, void* userdata) {
const JPH_NarrowPhaseQuery* query = JPH_PhysicsSystem_GetNarrowPhaseQueryNoLock(world->system);

JPH_Vec3 centerOfMass;
Expand Down
2 changes: 1 addition & 1 deletion src/modules/physics/physics_ode.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ bool lovrWorldShapecast(World* world, Shape* shape, float pose[7], float scale,
return false;
}

bool lovrWorldCollide(World* world, Shape* shape, float pose[7], float scale, uint32_t filter, CollideCallback* callback, void* userdata) {
bool lovrWorldCollideShape(World* world, Shape* shape, float pose[7], float scale, uint32_t filter, CollideCallback* callback, void* userdata) {
return false;
}

Expand Down

0 comments on commit a8f8f15

Please sign in to comment.