mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
use dt instead of inv_dt in RevoluteJoint::getMotorTorque
This commit is contained in:
@@ -101,8 +101,9 @@ float RevoluteJoint::getMotorSpeed() const
|
||||
return joint->GetMotorSpeed();
|
||||
}
|
||||
|
||||
float RevoluteJoint::getMotorTorque(float inv_dt) const
|
||||
float RevoluteJoint::getMotorTorque(float dt) const
|
||||
{
|
||||
float inv_dt = 1.0f / dt;
|
||||
return Physics::scaleUp(Physics::scaleUp(joint->GetMotorTorque(inv_dt)));
|
||||
}
|
||||
|
||||
|
||||
@@ -87,9 +87,9 @@ public:
|
||||
|
||||
/**
|
||||
* Get the current motor torque, usually in N-m.
|
||||
* @param inv_dt The inverse timestep.
|
||||
* @param dt The timestep.
|
||||
**/
|
||||
float getMotorTorque(float inv_dt) const;
|
||||
float getMotorTorque(float dt) const;
|
||||
|
||||
/**
|
||||
* Get the maximum motor torque, usually in N-m.
|
||||
|
||||
@@ -91,8 +91,8 @@ int w_RevoluteJoint_getMotorSpeed(lua_State *L)
|
||||
int w_RevoluteJoint_getMotorTorque(lua_State *L)
|
||||
{
|
||||
RevoluteJoint *t = luax_checkrevolutejoint(L, 1);
|
||||
float inv_dt = (float)luaL_checknumber(L, 2);
|
||||
lua_pushnumber(L, t->getMotorTorque(inv_dt));
|
||||
float dt = (float)luaL_checknumber(L, 2);
|
||||
lua_pushnumber(L, t->getMotorTorque(dt));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user