Joint:enableMotor -> Joint:setMotorEnabled, Joint:enableLimit -> Joint:setLimitsEnabled, Joint:isLimitEnabled -> Joint:hasLimitsEnabled. Resolves issue #691.

This commit is contained in:
Alex Szpakowski
2013-10-24 17:30:41 -03:00
parent cbd1e6937b
commit 74ac2820cd
12 changed files with 48 additions and 48 deletions
+5 -5
View File
@@ -61,9 +61,9 @@ float PrismaticJoint::getJointSpeed() const
return Physics::scaleUp(joint->GetJointSpeed()); return Physics::scaleUp(joint->GetJointSpeed());
} }
void PrismaticJoint::enableMotor(bool motor) void PrismaticJoint::setMotorEnabled(bool enable)
{ {
return joint->EnableMotor(motor); return joint->EnableMotor(enable);
} }
bool PrismaticJoint::isMotorEnabled() const bool PrismaticJoint::isMotorEnabled() const
@@ -96,12 +96,12 @@ float PrismaticJoint::getMaxMotorForce() const
return Physics::scaleUp(joint->GetMaxMotorForce()); return Physics::scaleUp(joint->GetMaxMotorForce());
} }
void PrismaticJoint::enableLimit(bool limit) void PrismaticJoint::setLimitsEnabled(bool enable)
{ {
joint->EnableLimit(limit); joint->EnableLimit(enable);
} }
bool PrismaticJoint::isLimitEnabled() const bool PrismaticJoint::hasLimitsEnabled() const
{ {
return joint->IsLimitEnabled(); return joint->IsLimitEnabled();
} }
+4 -4
View File
@@ -59,7 +59,7 @@ public:
/** /**
* Enable/disable the joint motor. * Enable/disable the joint motor.
**/ **/
void enableMotor(bool motor); void setMotorEnabled(bool enable);
/** /**
* Checks whether the motor is enabled. * Checks whether the motor is enabled.
@@ -93,14 +93,14 @@ public:
float getMaxMotorForce() const; float getMaxMotorForce() const;
/** /**
* Enable/disable the joint limit. * Enable/disable the joint limits.
**/ **/
void enableLimit(bool limit); void setLimitsEnabled(bool enable);
/** /**
* Checks whether limits are enabled. * Checks whether limits are enabled.
**/ **/
bool isLimitEnabled() const; bool hasLimitsEnabled() const;
/** /**
* Sets the upper limit, usually in meters. * Sets the upper limit, usually in meters.
+5 -5
View File
@@ -58,9 +58,9 @@ float RevoluteJoint::getJointSpeed() const
return joint->GetJointSpeed(); return joint->GetJointSpeed();
} }
void RevoluteJoint::enableMotor(bool motor) void RevoluteJoint::setMotorEnabled(bool enable)
{ {
return joint->EnableMotor(motor); return joint->EnableMotor(enable);
} }
bool RevoluteJoint::isMotorEnabled() const bool RevoluteJoint::isMotorEnabled() const
@@ -93,12 +93,12 @@ float RevoluteJoint::getMaxMotorTorque() const
return Physics::scaleUp(Physics::scaleUp(joint->GetMaxMotorTorque())); return Physics::scaleUp(Physics::scaleUp(joint->GetMaxMotorTorque()));
} }
void RevoluteJoint::enableLimit(bool limit) void RevoluteJoint::setLimitsEnabled(bool enable)
{ {
joint->EnableLimit(limit); joint->EnableLimit(enable);
} }
bool RevoluteJoint::isLimitEnabled() const bool RevoluteJoint::hasLimitsEnabled() const
{ {
return joint->IsLimitEnabled(); return joint->IsLimitEnabled();
} }
+3 -3
View File
@@ -59,7 +59,7 @@ public:
/** /**
* Enable/disable the joint motor. * Enable/disable the joint motor.
**/ **/
void enableMotor(bool motor); void setMotorEnabled(bool enable);
/** /**
* Checks whether the motor is enabled. * Checks whether the motor is enabled.
@@ -95,12 +95,12 @@ public:
/** /**
* Enable/disable the joint limit. * Enable/disable the joint limit.
**/ **/
void enableLimit(bool limit); void setLimitsEnabled(bool enable);
/** /**
* Checks whether limits are enabled. * Checks whether limits are enabled.
**/ **/
bool isLimitEnabled() const; bool hasLimitsEnabled() const;
/** /**
* Sets the upper limit in degrees. * Sets the upper limit in degrees.
+2 -2
View File
@@ -58,9 +58,9 @@ float WheelJoint::getJointSpeed() const
return Physics::scaleUp(joint->GetJointSpeed()); return Physics::scaleUp(joint->GetJointSpeed());
} }
void WheelJoint::enableMotor(bool motor) void WheelJoint::setMotorEnabled(bool enable)
{ {
return joint->EnableMotor(motor); return joint->EnableMotor(enable);
} }
bool WheelJoint::isMotorEnabled() const bool WheelJoint::isMotorEnabled() const
+1 -1
View File
@@ -60,7 +60,7 @@ public:
/** /**
* Enable/disable the joint motor. * Enable/disable the joint motor.
**/ **/
void enableMotor(bool motor); void setMotorEnabled(bool enable);
/** /**
* Checks whether the motor is enabled. * Checks whether the motor is enabled.
@@ -50,11 +50,11 @@ int w_PrismaticJoint_getJointSpeed(lua_State *L)
return 1; return 1;
} }
int w_PrismaticJoint_enableMotor(lua_State *L) int w_PrismaticJoint_setMotorEnabled(lua_State *L)
{ {
PrismaticJoint *t = luax_checkprismaticjoint(L, 1); PrismaticJoint *t = luax_checkprismaticjoint(L, 1);
bool arg1 = luax_toboolean(L, 2); bool arg1 = luax_toboolean(L, 2);
t->enableMotor(arg1); t->setMotorEnabled(arg1);
return 0; return 0;
} }
@@ -103,18 +103,18 @@ int w_PrismaticJoint_getMaxMotorForce(lua_State *L)
return 1; return 1;
} }
int w_PrismaticJoint_enableLimit(lua_State *L) int w_PrismaticJoint_setLimitsEnabled(lua_State *L)
{ {
PrismaticJoint *t = luax_checkprismaticjoint(L, 1); PrismaticJoint *t = luax_checkprismaticjoint(L, 1);
bool arg1 = luax_toboolean(L, 2); bool arg1 = luax_toboolean(L, 2);
t->enableLimit(arg1); t->setLimitsEnabled(arg1);
return 0; return 0;
} }
int w_PrismaticJoint_isLimitEnabled(lua_State *L) int w_PrismaticJoint_hasLimitsEnabled(lua_State *L)
{ {
PrismaticJoint *t = luax_checkprismaticjoint(L, 1); PrismaticJoint *t = luax_checkprismaticjoint(L, 1);
luax_pushboolean(L, t->isLimitEnabled()); luax_pushboolean(L, t->hasLimitsEnabled());
return 1; return 1;
} }
@@ -168,15 +168,15 @@ static const luaL_Reg functions[] =
{ {
{ "getJointTranslation", w_PrismaticJoint_getJointTranslation }, { "getJointTranslation", w_PrismaticJoint_getJointTranslation },
{ "getJointSpeed", w_PrismaticJoint_getJointSpeed }, { "getJointSpeed", w_PrismaticJoint_getJointSpeed },
{ "enableMotor", w_PrismaticJoint_enableMotor }, { "setMotorEnabled", w_PrismaticJoint_setMotorEnabled },
{ "isMotorEnabled", w_PrismaticJoint_isMotorEnabled }, { "isMotorEnabled", w_PrismaticJoint_isMotorEnabled },
{ "setMaxMotorForce", w_PrismaticJoint_setMaxMotorForce }, { "setMaxMotorForce", w_PrismaticJoint_setMaxMotorForce },
{ "setMotorSpeed", w_PrismaticJoint_setMotorSpeed }, { "setMotorSpeed", w_PrismaticJoint_setMotorSpeed },
{ "getMotorSpeed", w_PrismaticJoint_getMotorSpeed }, { "getMotorSpeed", w_PrismaticJoint_getMotorSpeed },
{ "getMotorForce", w_PrismaticJoint_getMotorForce }, { "getMotorForce", w_PrismaticJoint_getMotorForce },
{ "getMaxMotorForce", w_PrismaticJoint_getMaxMotorForce }, { "getMaxMotorForce", w_PrismaticJoint_getMaxMotorForce },
{ "enableLimit", w_PrismaticJoint_enableLimit }, { "setLimitsEnabled", w_PrismaticJoint_setLimitsEnabled },
{ "isLimitEnabled", w_PrismaticJoint_isLimitEnabled }, { "hasLimitsEnabled", w_PrismaticJoint_hasLimitsEnabled },
{ "setUpperLimit", w_PrismaticJoint_setUpperLimit }, { "setUpperLimit", w_PrismaticJoint_setUpperLimit },
{ "setLowerLimit", w_PrismaticJoint_setLowerLimit }, { "setLowerLimit", w_PrismaticJoint_setLowerLimit },
{ "setLimits", w_PrismaticJoint_setLimits }, { "setLimits", w_PrismaticJoint_setLimits },
@@ -36,15 +36,15 @@ namespace box2d
PrismaticJoint *luax_checkprismaticjoint(lua_State *L, int idx); PrismaticJoint *luax_checkprismaticjoint(lua_State *L, int idx);
int w_PrismaticJoint_getJointTranslation(lua_State *L); int w_PrismaticJoint_getJointTranslation(lua_State *L);
int w_PrismaticJoint_getJointSpeed(lua_State *L); int w_PrismaticJoint_getJointSpeed(lua_State *L);
int w_PrismaticJoint_enableMotor(lua_State *L); int w_PrismaticJoint_setMotorEnabled(lua_State *L);
int w_PrismaticJoint_isMotorEnabled(lua_State *L); int w_PrismaticJoint_isMotorEnabled(lua_State *L);
int w_PrismaticJoint_setMaxMotorForce(lua_State *L); int w_PrismaticJoint_setMaxMotorForce(lua_State *L);
int w_PrismaticJoint_setMotorSpeed(lua_State *L); int w_PrismaticJoint_setMotorSpeed(lua_State *L);
int w_PrismaticJoint_getMotorSpeed(lua_State *L); int w_PrismaticJoint_getMotorSpeed(lua_State *L);
int w_PrismaticJoint_getMotorForce(lua_State *L); int w_PrismaticJoint_getMotorForce(lua_State *L);
int w_PrismaticJoint_getMaxMotorForce(lua_State *L); int w_PrismaticJoint_getMaxMotorForce(lua_State *L);
int w_PrismaticJoint_enableLimit(lua_State *L); int w_PrismaticJoint_setLimitsEnabled(lua_State *L);
int w_PrismaticJoint_isLimitEnabled(lua_State *L); int w_PrismaticJoint_hasLimitsEnabled(lua_State *L);
int w_PrismaticJoint_setUpperLimit(lua_State *L); int w_PrismaticJoint_setUpperLimit(lua_State *L);
int w_PrismaticJoint_setLowerLimit(lua_State *L); int w_PrismaticJoint_setLowerLimit(lua_State *L);
int w_PrismaticJoint_setLimits(lua_State *L); int w_PrismaticJoint_setLimits(lua_State *L);
@@ -50,11 +50,11 @@ int w_RevoluteJoint_getJointSpeed(lua_State *L)
return 1; return 1;
} }
int w_RevoluteJoint_enableMotor(lua_State *L) int w_RevoluteJoint_setMotorEnabled(lua_State *L)
{ {
RevoluteJoint *t = luax_checkrevolutejoint(L, 1); RevoluteJoint *t = luax_checkrevolutejoint(L, 1);
bool arg1 = luax_toboolean(L, 2); bool arg1 = luax_toboolean(L, 2);
t->enableMotor(arg1); t->setMotorEnabled(arg1);
return 0; return 0;
} }
@@ -103,18 +103,18 @@ int w_RevoluteJoint_getMaxMotorTorque(lua_State *L)
return 1; return 1;
} }
int w_RevoluteJoint_enableLimit(lua_State *L) int w_RevoluteJoint_setLimitsEnabled(lua_State *L)
{ {
RevoluteJoint *t = luax_checkrevolutejoint(L, 1); RevoluteJoint *t = luax_checkrevolutejoint(L, 1);
bool arg1 = luax_toboolean(L, 2); bool arg1 = luax_toboolean(L, 2);
t->enableLimit(arg1); t->setLimitsEnabled(arg1);
return 0; return 0;
} }
int w_RevoluteJoint_isLimitEnabled(lua_State *L) int w_RevoluteJoint_hasLimitsEnabled(lua_State *L)
{ {
RevoluteJoint *t = luax_checkrevolutejoint(L, 1); RevoluteJoint *t = luax_checkrevolutejoint(L, 1);
luax_pushboolean(L, t->isLimitEnabled()); luax_pushboolean(L, t->hasLimitsEnabled());
return 1; return 1;
} }
@@ -168,15 +168,15 @@ static const luaL_Reg functions[] =
{ {
{ "getJointAngle", w_RevoluteJoint_getJointAngle }, { "getJointAngle", w_RevoluteJoint_getJointAngle },
{ "getJointSpeed", w_RevoluteJoint_getJointSpeed }, { "getJointSpeed", w_RevoluteJoint_getJointSpeed },
{ "enableMotor", w_RevoluteJoint_enableMotor }, { "setMotorEnabled", w_RevoluteJoint_setMotorEnabled },
{ "isMotorEnabled", w_RevoluteJoint_isMotorEnabled }, { "isMotorEnabled", w_RevoluteJoint_isMotorEnabled },
{ "setMaxMotorTorque", w_RevoluteJoint_setMaxMotorTorque }, { "setMaxMotorTorque", w_RevoluteJoint_setMaxMotorTorque },
{ "setMotorSpeed", w_RevoluteJoint_setMotorSpeed }, { "setMotorSpeed", w_RevoluteJoint_setMotorSpeed },
{ "getMotorSpeed", w_RevoluteJoint_getMotorSpeed }, { "getMotorSpeed", w_RevoluteJoint_getMotorSpeed },
{ "getMotorTorque", w_RevoluteJoint_getMotorTorque }, { "getMotorTorque", w_RevoluteJoint_getMotorTorque },
{ "getMaxMotorTorque", w_RevoluteJoint_getMaxMotorTorque }, { "getMaxMotorTorque", w_RevoluteJoint_getMaxMotorTorque },
{ "enableLimit", w_RevoluteJoint_enableLimit }, { "setLimitsEnabled", w_RevoluteJoint_setLimitsEnabled },
{ "isLimitEnabled", w_RevoluteJoint_isLimitEnabled }, { "hasLimitsEnabled", w_RevoluteJoint_hasLimitsEnabled },
{ "setUpperLimit", w_RevoluteJoint_setUpperLimit }, { "setUpperLimit", w_RevoluteJoint_setUpperLimit },
{ "setLowerLimit", w_RevoluteJoint_setLowerLimit }, { "setLowerLimit", w_RevoluteJoint_setLowerLimit },
{ "setLimits", w_RevoluteJoint_setLimits }, { "setLimits", w_RevoluteJoint_setLimits },
@@ -36,15 +36,15 @@ namespace box2d
RevoluteJoint *luax_checkrevolutejoint(lua_State *L, int idx); RevoluteJoint *luax_checkrevolutejoint(lua_State *L, int idx);
int w_RevoluteJoint_getJointAngle(lua_State *L); int w_RevoluteJoint_getJointAngle(lua_State *L);
int w_RevoluteJoint_getJointSpeed(lua_State *L); int w_RevoluteJoint_getJointSpeed(lua_State *L);
int w_RevoluteJoint_enableMotor(lua_State *L); int w_RevoluteJoint_setMotorEnabled(lua_State *L);
int w_RevoluteJoint_isMotorEnabled(lua_State *L); int w_RevoluteJoint_isMotorEnabled(lua_State *L);
int w_RevoluteJoint_setMaxMotorTorque(lua_State *L); int w_RevoluteJoint_setMaxMotorTorque(lua_State *L);
int w_RevoluteJoint_setMotorSpeed(lua_State *L); int w_RevoluteJoint_setMotorSpeed(lua_State *L);
int w_RevoluteJoint_getMotorSpeed(lua_State *L); int w_RevoluteJoint_getMotorSpeed(lua_State *L);
int w_RevoluteJoint_getMotorTorque(lua_State *L); int w_RevoluteJoint_getMotorTorque(lua_State *L);
int w_RevoluteJoint_getMaxMotorTorque(lua_State *L); int w_RevoluteJoint_getMaxMotorTorque(lua_State *L);
int w_RevoluteJoint_enableLimit(lua_State *L); int w_RevoluteJoint_setLimitsEnabled(lua_State *L);
int w_RevoluteJoint_isLimitEnabled(lua_State *L); int w_RevoluteJoint_hasLimitsEnabled(lua_State *L);
int w_RevoluteJoint_setUpperLimit(lua_State *L); int w_RevoluteJoint_setUpperLimit(lua_State *L);
int w_RevoluteJoint_setLowerLimit(lua_State *L); int w_RevoluteJoint_setLowerLimit(lua_State *L);
int w_RevoluteJoint_setLimits(lua_State *L); int w_RevoluteJoint_setLimits(lua_State *L);
@@ -49,11 +49,11 @@ int w_WheelJoint_getJointSpeed(lua_State *L)
return 1; return 1;
} }
int w_WheelJoint_enableMotor(lua_State *L) int w_WheelJoint_setMotorEnabled(lua_State *L)
{ {
WheelJoint *t = luax_checkwheeljoint(L, 1); WheelJoint *t = luax_checkwheeljoint(L, 1);
bool arg1 = luax_toboolean(L, 2); bool arg1 = luax_toboolean(L, 2);
t->enableMotor(arg1); t->setMotorEnabled(arg1);
return 0; return 0;
} }
@@ -136,7 +136,7 @@ static const luaL_Reg functions[] =
{ {
{ "getJointTranslation", w_WheelJoint_getJointTranslation }, { "getJointTranslation", w_WheelJoint_getJointTranslation },
{ "getJointSpeed", w_WheelJoint_getJointSpeed }, { "getJointSpeed", w_WheelJoint_getJointSpeed },
{ "enableMotor", w_WheelJoint_enableMotor }, { "setMotorEnabled", w_WheelJoint_setMotorEnabled },
{ "isMotorEnabled", w_WheelJoint_isMotorEnabled }, { "isMotorEnabled", w_WheelJoint_isMotorEnabled },
{ "setMotorSpeed", w_WheelJoint_setMotorSpeed }, { "setMotorSpeed", w_WheelJoint_setMotorSpeed },
{ "getMotorSpeed", w_WheelJoint_getMotorSpeed }, { "getMotorSpeed", w_WheelJoint_getMotorSpeed },
+1 -1
View File
@@ -36,7 +36,7 @@ namespace box2d
WheelJoint *luax_checkwheeljoint(lua_State *L, int idx); WheelJoint *luax_checkwheeljoint(lua_State *L, int idx);
int w_WheelJoint_getJointTranslation(lua_State *L); int w_WheelJoint_getJointTranslation(lua_State *L);
int w_WheelJoint_getJointSpeed(lua_State *L); int w_WheelJoint_getJointSpeed(lua_State *L);
int w_WheelJoint_enableMotor(lua_State *L); int w_WheelJoint_setMotorEnabled(lua_State *L);
int w_WheelJoint_isMotorEnabled(lua_State *L); int w_WheelJoint_isMotorEnabled(lua_State *L);
int w_WheelJoint_setMotorSpeed(lua_State *L); int w_WheelJoint_setMotorSpeed(lua_State *L);
int w_WheelJoint_getMotorSpeed(lua_State *L); int w_WheelJoint_getMotorSpeed(lua_State *L);