mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Add RevoluteJoint:getMaxMotorTorque
--HG-- branch : box2d-update
This commit is contained in:
@@ -88,6 +88,11 @@ namespace box2d
|
|||||||
return Physics::scaleUp(Physics::scaleUp(joint->GetMotorTorque(inv_dt)));
|
return Physics::scaleUp(Physics::scaleUp(joint->GetMotorTorque(inv_dt)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float RevoluteJoint::getMaxMotorTorque()
|
||||||
|
{
|
||||||
|
return Physics::scaleUp(Physics::scaleUp(joint->GetMaxMotorTorque()));
|
||||||
|
}
|
||||||
|
|
||||||
void RevoluteJoint::enableLimit(bool limit)
|
void RevoluteJoint::enableLimit(bool limit)
|
||||||
{
|
{
|
||||||
joint->EnableLimit(limit);
|
joint->EnableLimit(limit);
|
||||||
|
|||||||
@@ -91,6 +91,11 @@ namespace box2d
|
|||||||
**/
|
**/
|
||||||
float getMotorTorque(float inv_dt) const;
|
float getMotorTorque(float inv_dt) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the maximum motor torque, usually in N-m.
|
||||||
|
**/
|
||||||
|
float getMaxMotorTorque();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable/disable the joint limit.
|
* Enable/disable the joint limit.
|
||||||
**/
|
**/
|
||||||
|
|||||||
@@ -91,6 +91,13 @@ namespace box2d
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int w_RevoluteJoint_getMaxMotorTorque(lua_State * L)
|
||||||
|
{
|
||||||
|
RevoluteJoint * t = luax_checkrevolutejoint(L, 1);
|
||||||
|
lua_pushnumber(L, t->getMaxMotorTorque());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int w_RevoluteJoint_enableLimit(lua_State * L)
|
int w_RevoluteJoint_enableLimit(lua_State * L)
|
||||||
{
|
{
|
||||||
RevoluteJoint * t = luax_checkrevolutejoint(L, 1);
|
RevoluteJoint * t = luax_checkrevolutejoint(L, 1);
|
||||||
@@ -161,6 +168,7 @@ namespace box2d
|
|||||||
{ "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 },
|
||||||
{ "enableLimit", w_RevoluteJoint_enableLimit },
|
{ "enableLimit", w_RevoluteJoint_enableLimit },
|
||||||
{ "isLimitEnabled", w_RevoluteJoint_isLimitEnabled },
|
{ "isLimitEnabled", w_RevoluteJoint_isLimitEnabled },
|
||||||
{ "setUpperLimit", w_RevoluteJoint_setUpperLimit },
|
{ "setUpperLimit", w_RevoluteJoint_setUpperLimit },
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ namespace box2d
|
|||||||
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_enableLimit(lua_State * L);
|
int w_RevoluteJoint_enableLimit(lua_State * L);
|
||||||
int w_RevoluteJoint_isLimitEnabled(lua_State * L);
|
int w_RevoluteJoint_isLimitEnabled(lua_State * L);
|
||||||
int w_RevoluteJoint_setUpperLimit(lua_State * L);
|
int w_RevoluteJoint_setUpperLimit(lua_State * L);
|
||||||
|
|||||||
Reference in New Issue
Block a user