diff --git a/src/api/l_physics_shapes.c b/src/api/l_physics_shapes.c index 94c8a528..5c4de078 100644 --- a/src/api/l_physics_shapes.c +++ b/src/api/l_physics_shapes.c @@ -313,11 +313,11 @@ const luaL_Reg lovrSphereShape[] = { static int l_lovrBoxShapeGetDimensions(lua_State* L) { BoxShape* box = luax_checktype(L, 1, BoxShape); - float x, y, z; - lovrBoxShapeGetDimensions(box, &x, &y, &z); - lua_pushnumber(L, x); - lua_pushnumber(L, y); - lua_pushnumber(L, z); + float w, h, d; + lovrBoxShapeGetDimensions(box, &w, &h, &d); + lua_pushnumber(L, w); + lua_pushnumber(L, h); + lua_pushnumber(L, d); return 3; } diff --git a/src/modules/physics/physics.c b/src/modules/physics/physics.c index 1ff1935f..20d6554d 100644 --- a/src/modules/physics/physics.c +++ b/src/modules/physics/physics.c @@ -956,27 +956,27 @@ void lovrSphereShapeSetRadius(SphereShape* sphere, float radius) { dGeomSphereSetRadius(sphere->id, radius); } -BoxShape* lovrBoxShapeCreate(float x, float y, float z) { +BoxShape* lovrBoxShapeCreate(float w, float h, float d) { BoxShape* box = calloc(1, sizeof(BoxShape)); lovrAssert(box, "Out of memory"); box->ref = 1; box->type = SHAPE_BOX; - box->id = dCreateBox(0, x, y, z); + box->id = dCreateBox(0, w, h, d); dGeomSetData(box->id, box); return box; } -void lovrBoxShapeGetDimensions(BoxShape* box, float* x, float* y, float* z) { +void lovrBoxShapeGetDimensions(BoxShape* box, float* w, float* h, float* d) { dReal dimensions[4]; dGeomBoxGetLengths(box->id, dimensions); - *x = dimensions[0]; - *y = dimensions[1]; - *z = dimensions[2]; + *w = dimensions[0]; + *h = dimensions[1]; + *d = dimensions[2]; } -void lovrBoxShapeSetDimensions(BoxShape* box, float x, float y, float z) { - lovrCheck(x > 0.f && y > 0.f && z > 0.f, "BoxShape dimensions must be positive"); - dGeomBoxSetLengths(box->id, x, y, z); +void lovrBoxShapeSetDimensions(BoxShape* box, float w, float h, float d) { + lovrCheck(w > 0.f && h > 0.f && d > 0.f, "BoxShape dimensions must be positive"); + dGeomBoxSetLengths(box->id, w, h, d); } CapsuleShape* lovrCapsuleShapeCreate(float radius, float length) { diff --git a/src/modules/physics/physics.h b/src/modules/physics/physics.h index 310b5f98..d724170a 100644 --- a/src/modules/physics/physics.h +++ b/src/modules/physics/physics.h @@ -157,9 +157,9 @@ SphereShape* lovrSphereShapeCreate(float radius); float lovrSphereShapeGetRadius(SphereShape* sphere); void lovrSphereShapeSetRadius(SphereShape* sphere, float radius); -BoxShape* lovrBoxShapeCreate(float x, float y, float z); -void lovrBoxShapeGetDimensions(BoxShape* box, float* x, float* y, float* z); -void lovrBoxShapeSetDimensions(BoxShape* box, float x, float y, float z); +BoxShape* lovrBoxShapeCreate(float w, float h, float d); +void lovrBoxShapeGetDimensions(BoxShape* box, float* w, float* h, float* d); +void lovrBoxShapeSetDimensions(BoxShape* box, float w, float h, float d); CapsuleShape* lovrCapsuleShapeCreate(float radius, float length); float lovrCapsuleShapeGetRadius(CapsuleShape* capsule);