From 3dd1cb830519fe5e63842bd30d1b47a51a49b534 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 24 Nov 2009 23:39:33 +0000 Subject: [PATCH] renamed Object::addRel{Force,Torque} to add{Force,Torque}Rel git-svn-id: svn://anubis/anaglym/trunk@192 99a6e188-d820-4881-8870-2d33a10e2619 --- Engine.h | 8 ++++---- ag.cc | 31 ++++++++++--------------------- ag.h | 5 ++--- 3 files changed, 16 insertions(+), 28 deletions(-) diff --git a/Engine.h b/Engine.h index efc11a1..6eee940 100644 --- a/Engine.h +++ b/Engine.h @@ -43,17 +43,17 @@ class Engine { m_ode_object->addForce(fx, fy, fz); } - void addRelForce(dReal fx, dReal fy, dReal fz) + void addForceRel(dReal fx, dReal fy, dReal fz) { - m_ode_object->addRelForce(fx, fy, fz); + m_ode_object->addForceRel(fx, fy, fz); } void addTorque(dReal fx, dReal fy, dReal fz) { m_ode_object->addTorque(fx, fy, fz); } - void addRelTorque(dReal fx, dReal fy, dReal fz) + void addTorqueRel(dReal fx, dReal fy, dReal fz) { - m_ode_object->addRelTorque(fx, fy, fz); + m_ode_object->addTorqueRel(fx, fy, fz); } void setRotation(dReal x, dReal y, dReal z) { diff --git a/ag.cc b/ag.cc index 9702303..aed70fe 100644 --- a/ag.cc +++ b/ag.cc @@ -53,7 +53,6 @@ namespace ag { "createCylinder", createCylinder }, { "createCylinderStatic", createCylinderStatic }, { "createPlane", createPlane }, - { "createPlaneStatic", createPlaneStatic }, { "createSphere", createSphere }, { "createSphereStatic", createSphereStatic }, @@ -147,12 +146,12 @@ namespace ag lua_setfield(L, -2, "setVisible"); lua_pushcfunction(L, object::addForce); lua_setfield(L, -2, "addForce"); - lua_pushcfunction(L, object::addRelForce); - lua_setfield(L, -2, "addRelForce"); + lua_pushcfunction(L, object::addForceRel); + lua_setfield(L, -2, "addForceRel"); lua_pushcfunction(L, object::addTorque); lua_setfield(L, -2, "addTorque"); - lua_pushcfunction(L, object::addRelTorque); - lua_setfield(L, -2, "addRelTorque"); + lua_pushcfunction(L, object::addTorqueRel); + lua_setfield(L, -2, "addTorqueRel"); lua_pushcfunction(L, object::setColor); lua_setfield(L, -2, "setColor"); lua_pushcfunction(L, object::setTexture); @@ -567,7 +566,7 @@ namespace ag return createSphereSpecify(L, true); } - static int createPlaneSpecify(lua_State * L, bool is_static) + int createPlane(lua_State * L) { int argc = lua_gettop(L); if (argc == 4 || argc == 6) @@ -586,7 +585,7 @@ namespace ag refptr< vector > args = new vector(); for (int i = 1; i <= argc; i++) args->push_back(lua_tonumber(L, i)); - addManagedObject(L, is_static, OdeWorld::PLANE, args); + addManagedObject(L, true, OdeWorld::PLANE, args); return 1; } } @@ -594,16 +593,6 @@ namespace ag return 1; } - int createPlane(lua_State * L) - { - return createPlaneSpecify(L, false); - } - - int createPlaneStatic(lua_State * L) - { - return createPlaneSpecify(L, true); - } - static int createCylinderSpecify(lua_State * L, bool is_static) { int argc = lua_gettop(L); @@ -833,7 +822,7 @@ namespace ag return 0; } - int addRelForce(lua_State * L) + int addForceRel(lua_State * L) { int argc = lua_gettop(L); if (argc == 4) @@ -844,7 +833,7 @@ namespace ag lua_isnumber(L, 3) && lua_isnumber(L, 4)) { - obj->addRelForce(lua_tonumber(L, 2), + obj->addForceRel(lua_tonumber(L, 2), lua_tonumber(L, 3), lua_tonumber(L, 4)); } @@ -871,7 +860,7 @@ namespace ag return 0; } - int addRelTorque(lua_State * L) + int addTorqueRel(lua_State * L) { int argc = lua_gettop(L); if (argc == 4) @@ -882,7 +871,7 @@ namespace ag lua_isnumber(L, 3) && lua_isnumber(L, 4)) { - obj->addRelTorque(lua_tonumber(L, 2), + obj->addTorqueRel(lua_tonumber(L, 2), lua_tonumber(L, 3), lua_tonumber(L, 4)); } diff --git a/ag.h b/ag.h index dc2f696..8d54356 100644 --- a/ag.h +++ b/ag.h @@ -49,7 +49,6 @@ namespace ag int createCylinder(lua_State * L); int createCylinderStatic(lua_State * L); int createPlane(lua_State * L); - int createPlaneStatic(lua_State * L); int createSphere(lua_State * L); int createSphereStatic(lua_State * L); @@ -63,9 +62,9 @@ namespace ag int destroy(lua_State * L); int setVisible(lua_State * L); int addForce(lua_State * L); - int addRelForce(lua_State * L); + int addForceRel(lua_State * L); int addTorque(lua_State * L); - int addRelTorque(lua_State * L); + int addTorqueRel(lua_State * L); int setColor(lua_State * L); int setTexture(lua_State * L); int getMass(lua_State * L);