Support reference angle on revolute, prismatic, and weld joints (fixes #1194)

This commit is contained in:
airstruck
2016-08-19 14:36:36 +02:00
parent 78a2e80818
commit 154f7cbc7e
12 changed files with 154 additions and 14 deletions
+9
View File
@@ -43,6 +43,8 @@ public:
**/
WeldJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected);
WeldJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected, float referenceAngle);
virtual ~WeldJoint();
/**
@@ -67,10 +69,17 @@ public:
**/
float getDampingRatio() const;
/**
* Gets the reference angle.
**/
float getReferenceAngle() const;
private:
// The Box2D weld joint object.
b2WeldJoint *joint;
void init(b2WeldJointDef &def, Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected);
};
} // box2d