Browse Source

Finish wrapper function renames

Garrett Brown 5 years ago
parent
commit
59a1a4b2cd

+ 3 - 3
src/modules/physics/box2d/Body.cpp

@@ -370,7 +370,7 @@ void Body::setBullet(bool bullet)
 	return body->SetBullet(bullet);
 }
 
-bool Body::isActive() const
+bool Body::isEnabled() const
 {
 	return body->IsEnabled();
 }
@@ -390,9 +390,9 @@ bool Body::isSleepingAllowed() const
 	return body->IsSleepingAllowed();
 }
 
-void Body::setActive(bool active)
+void Body::SetEnabled(bool enabled)
 {
-	body->SetEnabled(active);
+	body->SetEnabled(enabled);
 }
 
 void Body::setAwake(bool awake)

+ 2 - 2
src/modules/physics/box2d/Body.h

@@ -350,7 +350,7 @@ public:
 	 * Checks whether a Body is active or not. An inactive body
 	 * cannot be interacted with.
 	 **/
-	bool isActive() const;
+	bool isEnabled() const;
 
 	/**
 	 * Checks whether a Body is awake or not. A Body
@@ -367,7 +367,7 @@ public:
 	/**
 	 * Changes the body's active state.
 	 **/
-	void setActive(bool active);
+	void SetEnabled(bool enabled);
 
 	/**
 	 * Changes the body's sleep state.

+ 2 - 14
src/modules/physics/box2d/ChainShape.cpp

@@ -50,11 +50,6 @@ void ChainShape::setNextVertex(float x, float y)
 	c->m_nextVertex = Physics::scaleDown(v);
 }
 
-void ChainShape::setNextVertex()
-{
-	b2ChainShape *c = (b2ChainShape *)shape;
-}
-
 void ChainShape::setPreviousVertex(float x, float y)
 {
 	b2Vec2 v(x, y);
@@ -62,29 +57,22 @@ void ChainShape::setPreviousVertex(float x, float y)
 	c->m_prevVertex = Physics::scaleDown(v);
 }
 
-void ChainShape::setPreviousVertex()
-{
-	b2ChainShape *c = (b2ChainShape *)shape;
-}
-
-bool ChainShape::getNextVertex(float &x, float &y) const
+void ChainShape::getNextVertex(float &x, float &y) const
 {
 	b2ChainShape *c = (b2ChainShape *)shape;
 
 	b2Vec2 v = Physics::scaleUp(c->m_nextVertex);
 	x = v.x;
 	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;
 
 	b2Vec2 v = Physics::scaleUp(c->m_prevVertex);
 	x = v.x;
 	y = v.y;
-	return true;
 }
 
 EdgeShape *ChainShape::getChildEdge(int index) const

+ 2 - 4
src/modules/physics/box2d/ChainShape.h

@@ -56,7 +56,6 @@ public:
 	 * @param y The y-coordinate of the vertex.
 	 **/
 	void setNextVertex(float x, float y);
-	void setNextVertex();
 
 	/**
 	 * Establish connectivity to a vertex that precedes
@@ -65,17 +64,16 @@ public:
 	 * @param y The y-coordinate of the vertex.
 	 **/
 	void setPreviousVertex(float x, float y);
-	void setPreviousVertex();
 
 	/**
 	 * 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.
 	 **/
-	bool getPreviousVertex(float &x, float &y) const;
+	void getPreviousVertex(float &x, float &y) const;
 
 	/**
 	 * Returns a child EdgeShape.

+ 4 - 4
src/modules/physics/box2d/DistanceJoint.cpp

@@ -56,22 +56,22 @@ float DistanceJoint::getLength() const
 	return Physics::scaleUp(joint->GetLength());
 }
 
-void DistanceJoint::setFrequency(float hz)
+void DistanceJoint::setStiffness(float hz)
 {
 	joint->SetStiffness(hz);
 }
 
-float DistanceJoint::getFrequency() const
+float DistanceJoint::getStiffness() const
 {
 	return joint->GetStiffness();
 }
 
-void DistanceJoint::setDampingRatio(float d)
+void DistanceJoint::setDamping(float d)
 {
 	joint->SetDamping(d);
 }
 
-float DistanceJoint::getDampingRatio() const
+float DistanceJoint::getDamping() const
 {
 	return joint->GetDamping();
 }

+ 4 - 4
src/modules/physics/box2d/DistanceJoint.h

@@ -59,24 +59,24 @@ public:
 	/**
 	 * Sets the response speed.
 	 **/
-	void setFrequency(float hz);
+	void setStiffness(float hz);
 
 	/**
 	 * Gets the response speed.
 	 **/
-	float getFrequency() const;
+	float getStiffness() const;
 
 	/**
 	 * Sets the damping ratio.
 	 * 0 = no damping, 1 = critical damping.
 	 **/
-	void setDampingRatio(float d);
+	void setDamping(float d);
 
 	/**
 	 * Gets the damping ratio.
 	 * 0 = no damping, 1 = critical damping.
 	 **/
-	float getDampingRatio() const;
+	float getDamping() const;
 
 private:
 	// The Box2D DistanceJoint object.

+ 2 - 14
src/modules/physics/box2d/EdgeShape.cpp

@@ -50,19 +50,13 @@ void EdgeShape::setNextVertex(float x, float y)
 	e->m_vertex3 = Physics::scaleDown(v);
 }
 
-void EdgeShape::setNextVertex()
-{
-	b2EdgeShape *e = (b2EdgeShape *)shape;
-}
-
-bool EdgeShape::getNextVertex(float &x, float &y) const
+void EdgeShape::getNextVertex(float &x, float &y) const
 {
 	b2EdgeShape *e = (b2EdgeShape *)shape;
 
 	b2Vec2 v = Physics::scaleUp(e->m_vertex3);
 	x = v.x;
 	y = v.y;
-	return true;
 }
 
 void EdgeShape::setPreviousVertex(float x, float y)
@@ -72,19 +66,13 @@ void EdgeShape::setPreviousVertex(float x, float y)
 	e->m_vertex0 = Physics::scaleDown(v);
 }
 
-void EdgeShape::setPreviousVertex()
-{
-	b2EdgeShape *e = (b2EdgeShape *)shape;
-}
-
-bool EdgeShape::getPreviousVertex(float &x, float &y) const
+void EdgeShape::getPreviousVertex(float &x, float &y) const
 {
 	b2EdgeShape *e = (b2EdgeShape *)shape;
 
 	b2Vec2 v = Physics::scaleUp(e->m_vertex0);
 	x = v.x;
 	y = v.y;
-	return true;
 }
 
 int EdgeShape::getPoints(lua_State *L)

+ 2 - 4
src/modules/physics/box2d/EdgeShape.h

@@ -50,12 +50,10 @@ public:
 	virtual ~EdgeShape();
 
 	void setNextVertex(float x, float y);
-	void setNextVertex();
-	bool getNextVertex(float &x, float &y) const;
+	void getNextVertex(float &x, float &y) const;
 
 	void setPreviousVertex(float x, float y);
-	void setPreviousVertex();
-	bool getPreviousVertex(float &x, float &y) const;
+	void getPreviousVertex(float &x, float &y) const;
 
 	/**
 	 * Returns the transformed points of the edge shape.

+ 1 - 1
src/modules/physics/box2d/Joint.cpp

@@ -185,7 +185,7 @@ void Joint::destroyJoint(bool implicit)
 	this->release();
 }
 
-bool Joint::isActive() const
+bool Joint::isEnabled() const
 {
 	return joint->IsEnabled();
 }

+ 1 - 1
src/modules/physics/box2d/Joint.h

@@ -103,7 +103,7 @@ public:
 	 **/
 	float getReactionTorque(float dt);
 
-	bool isActive() const;
+	bool isEnabled() const;
 
 	bool getCollideConnected() const;
 

+ 6 - 6
src/modules/physics/box2d/MouseJoint.cpp

@@ -78,28 +78,28 @@ float MouseJoint::getMaxForce() const
 	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
 	// go into that calculation...
 	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);
 }
 
-float MouseJoint::getFrequency() const
+float MouseJoint::getStiffness() const
 {
 	return joint->GetStiffness();
 }
 
-void MouseJoint::setDampingRatio(float d)
+void MouseJoint::setDamping(float d)
 {
 	joint->SetDamping(d);
 }
 
-float MouseJoint::getDampingRatio() const
+float MouseJoint::getDamping() const
 {
 	return joint->GetDamping();
 }

+ 4 - 4
src/modules/physics/box2d/MouseJoint.h

@@ -78,24 +78,24 @@ public:
 	/**
 	 * Sets the response speed.
 	 **/
-	void setFrequency(float hz);
+	void setStiffness(float hz);
 
 	/**
 	 * Gets the response speed.
 	 **/
-	float getFrequency() const;
+	float getStiffness() const;
 
 	/**
 	 * Sets the damping ratio.
 	 * 0 = no damping, 1 = critical damping.
 	 **/
-	void setDampingRatio(float d);
+	void setDamping(float d);
 
 	/**
 	 * Gets the damping ratio.
 	 * 0 = no damping, 1 = critical damping.
 	 **/
-	float getDampingRatio() const;
+	float getDamping() const;
 
 	virtual Body *getBodyA() const;
 	virtual Body *getBodyB() const;

+ 4 - 4
src/modules/physics/box2d/WeldJoint.cpp

@@ -66,22 +66,22 @@ void WeldJoint::init(b2WeldJointDef &def, Body *body1, Body *body2, float xA, fl
 	def.collideConnected = collideConnected;
 }
 
-void WeldJoint::setFrequency(float hz)
+void WeldJoint::setStiffness(float hz)
 {
 	joint->SetStiffness(hz);
 }
 
-float WeldJoint::getFrequency() const
+float WeldJoint::getStiffness() const
 {
 	return joint->GetStiffness();
 }
 
-void WeldJoint::setDampingRatio(float d)
+void WeldJoint::setDamping(float d)
 {
 	joint->SetDamping(d);
 }
 
-float WeldJoint::getDampingRatio() const
+float WeldJoint::getDamping() const
 {
 	return joint->GetDamping();
 }

+ 4 - 4
src/modules/physics/box2d/WeldJoint.h

@@ -52,24 +52,24 @@ public:
 	/**
 	 * Sets the response speed.
 	 **/
-	void setFrequency(float hz);
+	void setStiffness(float hz);
 
 	/**
 	 * Gets the response speed.
 	 **/
-	float getFrequency() const;
+	float getStiffness() const;
 
 	/**
 	 * Sets the damping ratio.
 	 * 0 = no damping, 1 = critical damping.
 	 **/
-	void setDampingRatio(float d);
+	void setDamping(float d);
 
 	/**
 	 * Gets the damping ratio.
 	 * 0 = no damping, 1 = critical damping.
 	 **/
-	float getDampingRatio() const;
+	float getDamping() const;
 
 	/**
 	 * Gets the reference angle.

+ 4 - 4
src/modules/physics/box2d/WheelJoint.cpp

@@ -95,22 +95,22 @@ float WheelJoint::getMotorTorque(float inv_dt) const
 	return Physics::scaleUp(Physics::scaleUp(joint->GetMotorTorque(inv_dt)));
 }
 
-void WheelJoint::setSpringFrequency(float hz)
+void WheelJoint::setStiffness(float hz)
 {
 	joint->SetStiffness(hz);
 }
 
-float WheelJoint::getSpringFrequency() const
+float WheelJoint::getStiffness() const
 {
 	return joint->GetStiffness();
 }
 
-void WheelJoint::setSpringDampingRatio(float ratio)
+void WheelJoint::setDamping(float ratio)
 {
 	joint->SetDamping(ratio);
 }
 
-float WheelJoint::getSpringDampingRatio() const
+float WheelJoint::getDamping() const
 {
 	return joint->GetDamping();
 }

+ 4 - 4
src/modules/physics/box2d/WheelJoint.h

@@ -99,22 +99,22 @@ public:
 	 * Set the spring frequency, in hertz. Setting the frequency to 0
 	 * disables the spring.
 	 **/
-	void setSpringFrequency(float hz);
+	void setStiffness(float hz);
 
 	/**
 	 * Get the spring frequency, in hertz.
 	 **/
-	float getSpringFrequency() const;
+	float getStiffness() const;
 
 	/**
 	 * Set the spring damping ratio.
 	 **/
-	void setSpringDampingRatio(float ratio);
+	void setDamping(float ratio);
 
 	/**
 	 * Get the spring damping ratio.
 	 **/
-	float getSpringDampingRatio() const;
+	float getDamping() const;
 
 	/**
 	 * Gets the axis unit vector, relative to body1.