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
@@ -44,6 +44,8 @@ public:
**/
RevoluteJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected);
RevoluteJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected, float referenceAngle);
virtual ~RevoluteJoint();
/**
@@ -134,10 +136,17 @@ public:
**/
int getLimits(lua_State *L);
/**
* Gets the reference angle.
**/
float getReferenceAngle() const;
private:
// The Box2D revolute joint object.
b2RevoluteJoint *joint;
void init(b2RevoluteJointDef &def, Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected);
};
} // box2d