Finish wrapper function renames

This commit is contained in:
Garrett Brown
2020-08-16 18:25:27 -04:00
parent a5004f4c8d
commit 59a1a4b2cd
16 changed files with 49 additions and 77 deletions
+3 -3
View File
@@ -370,7 +370,7 @@ void Body::setBullet(bool bullet)
return body->SetBullet(bullet); return body->SetBullet(bullet);
} }
bool Body::isActive() const bool Body::isEnabled() const
{ {
return body->IsEnabled(); return body->IsEnabled();
} }
@@ -390,9 +390,9 @@ bool Body::isSleepingAllowed() const
return body->IsSleepingAllowed(); return body->IsSleepingAllowed();
} }
void Body::setActive(bool active) void Body::SetEnabled(bool enabled)
{ {
body->SetEnabled(active); body->SetEnabled(enabled);
} }
void Body::setAwake(bool awake) void Body::setAwake(bool awake)
+2 -2
View File
@@ -350,7 +350,7 @@ public:
* Checks whether a Body is active or not. An inactive body * Checks whether a Body is active or not. An inactive body
* cannot be interacted with. * cannot be interacted with.
**/ **/
bool isActive() const; bool isEnabled() const;
/** /**
* Checks whether a Body is awake or not. A Body * Checks whether a Body is awake or not. A Body
@@ -367,7 +367,7 @@ public:
/** /**
* Changes the body's active state. * Changes the body's active state.
**/ **/
void setActive(bool active); void SetEnabled(bool enabled);
/** /**
* Changes the body's sleep state. * Changes the body's sleep state.
+2 -14
View File
@@ -50,11 +50,6 @@ void ChainShape::setNextVertex(float x, float y)
c->m_nextVertex = Physics::scaleDown(v); c->m_nextVertex = Physics::scaleDown(v);
} }
void ChainShape::setNextVertex()
{
b2ChainShape *c = (b2ChainShape *)shape;
}
void ChainShape::setPreviousVertex(float x, float y) void ChainShape::setPreviousVertex(float x, float y)
{ {
b2Vec2 v(x, y); b2Vec2 v(x, y);
@@ -62,29 +57,22 @@ void ChainShape::setPreviousVertex(float x, float y)
c->m_prevVertex = Physics::scaleDown(v); c->m_prevVertex = Physics::scaleDown(v);
} }
void ChainShape::setPreviousVertex() void ChainShape::getNextVertex(float &x, float &y) const
{
b2ChainShape *c = (b2ChainShape *)shape;
}
bool ChainShape::getNextVertex(float &x, float &y) const
{ {
b2ChainShape *c = (b2ChainShape *)shape; b2ChainShape *c = (b2ChainShape *)shape;
b2Vec2 v = Physics::scaleUp(c->m_nextVertex); b2Vec2 v = Physics::scaleUp(c->m_nextVertex);
x = v.x; x = v.x;
y = v.y; y = v.y;
return true;
} }
bool ChainShape::getPreviousVertex(float &x, float &y) const void ChainShape::getPreviousVertex(float &x, float &y) const
{ {
b2ChainShape *c = (b2ChainShape *)shape; b2ChainShape *c = (b2ChainShape *)shape;
b2Vec2 v = Physics::scaleUp(c->m_prevVertex); b2Vec2 v = Physics::scaleUp(c->m_prevVertex);
x = v.x; x = v.x;
y = v.y; y = v.y;
return true;
} }
EdgeShape *ChainShape::getChildEdge(int index) const EdgeShape *ChainShape::getChildEdge(int index) const
+2 -4
View File
@@ -56,7 +56,6 @@ public:
* @param y The y-coordinate of the vertex. * @param y The y-coordinate of the vertex.
**/ **/
void setNextVertex(float x, float y); void setNextVertex(float x, float y);
void setNextVertex();
/** /**
* Establish connectivity to a vertex that precedes * Establish connectivity to a vertex that precedes
@@ -65,17 +64,16 @@ public:
* @param y The y-coordinate of the vertex. * @param y The y-coordinate of the vertex.
**/ **/
void setPreviousVertex(float x, float y); void setPreviousVertex(float x, float y);
void setPreviousVertex();
/** /**
* Gets the vertex that follows the last vertex. * Gets the vertex that follows the last vertex.
**/ **/
bool getNextVertex(float &x, float &y) const; void getNextVertex(float &x, float &y) const;
/** /**
* Gets the vertex that precedes the first vertex. * Gets the vertex that precedes the first vertex.
**/ **/
bool getPreviousVertex(float &x, float &y) const; void getPreviousVertex(float &x, float &y) const;
/** /**
* Returns a child EdgeShape. * Returns a child EdgeShape.
+4 -4
View File
@@ -56,22 +56,22 @@ float DistanceJoint::getLength() const
return Physics::scaleUp(joint->GetLength()); return Physics::scaleUp(joint->GetLength());
} }
void DistanceJoint::setFrequency(float hz) void DistanceJoint::setStiffness(float hz)
{ {
joint->SetStiffness(hz); joint->SetStiffness(hz);
} }
float DistanceJoint::getFrequency() const float DistanceJoint::getStiffness() const
{ {
return joint->GetStiffness(); return joint->GetStiffness();
} }
void DistanceJoint::setDampingRatio(float d) void DistanceJoint::setDamping(float d)
{ {
joint->SetDamping(d); joint->SetDamping(d);
} }
float DistanceJoint::getDampingRatio() const float DistanceJoint::getDamping() const
{ {
return joint->GetDamping(); return joint->GetDamping();
} }
+4 -4
View File
@@ -59,24 +59,24 @@ public:
/** /**
* Sets the response speed. * Sets the response speed.
**/ **/
void setFrequency(float hz); void setStiffness(float hz);
/** /**
* Gets the response speed. * Gets the response speed.
**/ **/
float getFrequency() const; float getStiffness() const;
/** /**
* Sets the damping ratio. * Sets the damping ratio.
* 0 = no damping, 1 = critical damping. * 0 = no damping, 1 = critical damping.
**/ **/
void setDampingRatio(float d); void setDamping(float d);
/** /**
* Gets the damping ratio. * Gets the damping ratio.
* 0 = no damping, 1 = critical damping. * 0 = no damping, 1 = critical damping.
**/ **/
float getDampingRatio() const; float getDamping() const;
private: private:
// The Box2D DistanceJoint object. // The Box2D DistanceJoint object.
+2 -14
View File
@@ -50,19 +50,13 @@ void EdgeShape::setNextVertex(float x, float y)
e->m_vertex3 = Physics::scaleDown(v); e->m_vertex3 = Physics::scaleDown(v);
} }
void EdgeShape::setNextVertex() void EdgeShape::getNextVertex(float &x, float &y) const
{
b2EdgeShape *e = (b2EdgeShape *)shape;
}
bool EdgeShape::getNextVertex(float &x, float &y) const
{ {
b2EdgeShape *e = (b2EdgeShape *)shape; b2EdgeShape *e = (b2EdgeShape *)shape;
b2Vec2 v = Physics::scaleUp(e->m_vertex3); b2Vec2 v = Physics::scaleUp(e->m_vertex3);
x = v.x; x = v.x;
y = v.y; y = v.y;
return true;
} }
void EdgeShape::setPreviousVertex(float x, float y) void EdgeShape::setPreviousVertex(float x, float y)
@@ -72,19 +66,13 @@ void EdgeShape::setPreviousVertex(float x, float y)
e->m_vertex0 = Physics::scaleDown(v); e->m_vertex0 = Physics::scaleDown(v);
} }
void EdgeShape::setPreviousVertex() void EdgeShape::getPreviousVertex(float &x, float &y) const
{
b2EdgeShape *e = (b2EdgeShape *)shape;
}
bool EdgeShape::getPreviousVertex(float &x, float &y) const
{ {
b2EdgeShape *e = (b2EdgeShape *)shape; b2EdgeShape *e = (b2EdgeShape *)shape;
b2Vec2 v = Physics::scaleUp(e->m_vertex0); b2Vec2 v = Physics::scaleUp(e->m_vertex0);
x = v.x; x = v.x;
y = v.y; y = v.y;
return true;
} }
int EdgeShape::getPoints(lua_State *L) int EdgeShape::getPoints(lua_State *L)
+2 -4
View File
@@ -50,12 +50,10 @@ public:
virtual ~EdgeShape(); virtual ~EdgeShape();
void setNextVertex(float x, float y); void setNextVertex(float x, float y);
void setNextVertex(); void getNextVertex(float &x, float &y) const;
bool getNextVertex(float &x, float &y) const;
void setPreviousVertex(float x, float y); void setPreviousVertex(float x, float y);
void setPreviousVertex(); void getPreviousVertex(float &x, float &y) const;
bool getPreviousVertex(float &x, float &y) const;
/** /**
* Returns the transformed points of the edge shape. * Returns the transformed points of the edge shape.
+1 -1
View File
@@ -185,7 +185,7 @@ void Joint::destroyJoint(bool implicit)
this->release(); this->release();
} }
bool Joint::isActive() const bool Joint::isEnabled() const
{ {
return joint->IsEnabled(); return joint->IsEnabled();
} }
+1 -1
View File
@@ -103,7 +103,7 @@ public:
**/ **/
float getReactionTorque(float dt); float getReactionTorque(float dt);
bool isActive() const; bool isEnabled() const;
bool getCollideConnected() const; bool getCollideConnected() const;
+6 -6
View File
@@ -78,28 +78,28 @@ float MouseJoint::getMaxForce() const
return Physics::scaleUp(joint->GetMaxForce()); return Physics::scaleUp(joint->GetMaxForce());
} }
void MouseJoint::setFrequency(float hz) void MouseJoint::setStiffness(float hz)
{ {
// This is kind of a crappy check. The frequency is used in an internal // This is kind of a crappy check. The Stiffness is used in an internal
// box2d calculation whose result must be > FLT_EPSILON, but other variables // box2d calculation whose result must be > FLT_EPSILON, but other variables
// go into that calculation... // go into that calculation...
if (hz <= FLT_EPSILON * 2) if (hz <= FLT_EPSILON * 2)
throw love::Exception("MouseJoint frequency must be a positive number."); throw love::Exception("MouseJoint Stiffness must be a positive number.");
joint->SetStiffness(hz); joint->SetStiffness(hz);
} }
float MouseJoint::getFrequency() const float MouseJoint::getStiffness() const
{ {
return joint->GetStiffness(); return joint->GetStiffness();
} }
void MouseJoint::setDampingRatio(float d) void MouseJoint::setDamping(float d)
{ {
joint->SetDamping(d); joint->SetDamping(d);
} }
float MouseJoint::getDampingRatio() const float MouseJoint::getDamping() const
{ {
return joint->GetDamping(); return joint->GetDamping();
} }
+4 -4
View File
@@ -78,24 +78,24 @@ public:
/** /**
* Sets the response speed. * Sets the response speed.
**/ **/
void setFrequency(float hz); void setStiffness(float hz);
/** /**
* Gets the response speed. * Gets the response speed.
**/ **/
float getFrequency() const; float getStiffness() const;
/** /**
* Sets the damping ratio. * Sets the damping ratio.
* 0 = no damping, 1 = critical damping. * 0 = no damping, 1 = critical damping.
**/ **/
void setDampingRatio(float d); void setDamping(float d);
/** /**
* Gets the damping ratio. * Gets the damping ratio.
* 0 = no damping, 1 = critical damping. * 0 = no damping, 1 = critical damping.
**/ **/
float getDampingRatio() const; float getDamping() const;
virtual Body *getBodyA() const; virtual Body *getBodyA() const;
virtual Body *getBodyB() const; virtual Body *getBodyB() const;
+4 -4
View File
@@ -66,22 +66,22 @@ void WeldJoint::init(b2WeldJointDef &def, Body *body1, Body *body2, float xA, fl
def.collideConnected = collideConnected; def.collideConnected = collideConnected;
} }
void WeldJoint::setFrequency(float hz) void WeldJoint::setStiffness(float hz)
{ {
joint->SetStiffness(hz); joint->SetStiffness(hz);
} }
float WeldJoint::getFrequency() const float WeldJoint::getStiffness() const
{ {
return joint->GetStiffness(); return joint->GetStiffness();
} }
void WeldJoint::setDampingRatio(float d) void WeldJoint::setDamping(float d)
{ {
joint->SetDamping(d); joint->SetDamping(d);
} }
float WeldJoint::getDampingRatio() const float WeldJoint::getDamping() const
{ {
return joint->GetDamping(); return joint->GetDamping();
} }
+4 -4
View File
@@ -52,24 +52,24 @@ public:
/** /**
* Sets the response speed. * Sets the response speed.
**/ **/
void setFrequency(float hz); void setStiffness(float hz);
/** /**
* Gets the response speed. * Gets the response speed.
**/ **/
float getFrequency() const; float getStiffness() const;
/** /**
* Sets the damping ratio. * Sets the damping ratio.
* 0 = no damping, 1 = critical damping. * 0 = no damping, 1 = critical damping.
**/ **/
void setDampingRatio(float d); void setDamping(float d);
/** /**
* Gets the damping ratio. * Gets the damping ratio.
* 0 = no damping, 1 = critical damping. * 0 = no damping, 1 = critical damping.
**/ **/
float getDampingRatio() const; float getDamping() const;
/** /**
* Gets the reference angle. * Gets the reference angle.
+4 -4
View File
@@ -95,22 +95,22 @@ float WheelJoint::getMotorTorque(float inv_dt) const
return Physics::scaleUp(Physics::scaleUp(joint->GetMotorTorque(inv_dt))); return Physics::scaleUp(Physics::scaleUp(joint->GetMotorTorque(inv_dt)));
} }
void WheelJoint::setSpringFrequency(float hz) void WheelJoint::setStiffness(float hz)
{ {
joint->SetStiffness(hz); joint->SetStiffness(hz);
} }
float WheelJoint::getSpringFrequency() const float WheelJoint::getStiffness() const
{ {
return joint->GetStiffness(); return joint->GetStiffness();
} }
void WheelJoint::setSpringDampingRatio(float ratio) void WheelJoint::setDamping(float ratio)
{ {
joint->SetDamping(ratio); joint->SetDamping(ratio);
} }
float WheelJoint::getSpringDampingRatio() const float WheelJoint::getDamping() const
{ {
return joint->GetDamping(); return joint->GetDamping();
} }
+4 -4
View File
@@ -99,22 +99,22 @@ public:
* Set the spring frequency, in hertz. Setting the frequency to 0 * Set the spring frequency, in hertz. Setting the frequency to 0
* disables the spring. * disables the spring.
**/ **/
void setSpringFrequency(float hz); void setStiffness(float hz);
/** /**
* Get the spring frequency, in hertz. * Get the spring frequency, in hertz.
**/ **/
float getSpringFrequency() const; float getStiffness() const;
/** /**
* Set the spring damping ratio. * Set the spring damping ratio.
**/ **/
void setSpringDampingRatio(float ratio); void setDamping(float ratio);
/** /**
* Get the spring damping ratio. * Get the spring damping ratio.
**/ **/
float getSpringDampingRatio() const; float getDamping() const;
/** /**
* Gets the axis unit vector, relative to body1. * Gets the axis unit vector, relative to body1.