diff --git a/src/modules/physics/box2d/Body.cpp b/src/modules/physics/box2d/Body.cpp index 05a287f8f..abba1a202 100644 --- a/src/modules/physics/box2d/Body.cpp +++ b/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) diff --git a/src/modules/physics/box2d/Body.h b/src/modules/physics/box2d/Body.h index 6c2edcc62..f5281c486 100644 --- a/src/modules/physics/box2d/Body.h +++ b/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. diff --git a/src/modules/physics/box2d/ChainShape.cpp b/src/modules/physics/box2d/ChainShape.cpp index d0326d741..0d2a83de6 100644 --- a/src/modules/physics/box2d/ChainShape.cpp +++ b/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 diff --git a/src/modules/physics/box2d/ChainShape.h b/src/modules/physics/box2d/ChainShape.h index 06c192be1..67d7e7a7b 100644 --- a/src/modules/physics/box2d/ChainShape.h +++ b/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. diff --git a/src/modules/physics/box2d/DistanceJoint.cpp b/src/modules/physics/box2d/DistanceJoint.cpp index b1a67cd66..ffe80a8d6 100644 --- a/src/modules/physics/box2d/DistanceJoint.cpp +++ b/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(); } diff --git a/src/modules/physics/box2d/DistanceJoint.h b/src/modules/physics/box2d/DistanceJoint.h index 10c61db18..3ca572525 100644 --- a/src/modules/physics/box2d/DistanceJoint.h +++ b/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. diff --git a/src/modules/physics/box2d/EdgeShape.cpp b/src/modules/physics/box2d/EdgeShape.cpp index 68cc4b09a..5810851e7 100644 --- a/src/modules/physics/box2d/EdgeShape.cpp +++ b/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) diff --git a/src/modules/physics/box2d/EdgeShape.h b/src/modules/physics/box2d/EdgeShape.h index 0eb814eac..591606686 100644 --- a/src/modules/physics/box2d/EdgeShape.h +++ b/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. diff --git a/src/modules/physics/box2d/Joint.cpp b/src/modules/physics/box2d/Joint.cpp index 0cd08455d..b1d8cccaa 100644 --- a/src/modules/physics/box2d/Joint.cpp +++ b/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(); } diff --git a/src/modules/physics/box2d/Joint.h b/src/modules/physics/box2d/Joint.h index 094c54b2c..31ebdbe79 100644 --- a/src/modules/physics/box2d/Joint.h +++ b/src/modules/physics/box2d/Joint.h @@ -103,7 +103,7 @@ public: **/ float getReactionTorque(float dt); - bool isActive() const; + bool isEnabled() const; bool getCollideConnected() const; diff --git a/src/modules/physics/box2d/MouseJoint.cpp b/src/modules/physics/box2d/MouseJoint.cpp index 814e507e2..49f2d5f5f 100644 --- a/src/modules/physics/box2d/MouseJoint.cpp +++ b/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(); } diff --git a/src/modules/physics/box2d/MouseJoint.h b/src/modules/physics/box2d/MouseJoint.h index 648f26eab..633df0282 100644 --- a/src/modules/physics/box2d/MouseJoint.h +++ b/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; diff --git a/src/modules/physics/box2d/WeldJoint.cpp b/src/modules/physics/box2d/WeldJoint.cpp index efdc6e948..df304596a 100644 --- a/src/modules/physics/box2d/WeldJoint.cpp +++ b/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(); } diff --git a/src/modules/physics/box2d/WeldJoint.h b/src/modules/physics/box2d/WeldJoint.h index a6e7714c0..d269549e3 100644 --- a/src/modules/physics/box2d/WeldJoint.h +++ b/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. diff --git a/src/modules/physics/box2d/WheelJoint.cpp b/src/modules/physics/box2d/WheelJoint.cpp index 1d3035ee9..092b6ccf8 100644 --- a/src/modules/physics/box2d/WheelJoint.cpp +++ b/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(); } diff --git a/src/modules/physics/box2d/WheelJoint.h b/src/modules/physics/box2d/WheelJoint.h index 0ee597b3e..fe2ecc4a6 100644 --- a/src/modules/physics/box2d/WheelJoint.h +++ b/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.