Added 2-point version of love.physics.newRevoluteJoint (fixes #1175)

This commit is contained in:
airstruck
2016-07-07 21:18:35 +02:00
parent 24da8433d0
commit 9a2f99dc3d
6 changed files with 29 additions and 12 deletions
+3 -2
View File
@@ -34,12 +34,13 @@ namespace physics
namespace box2d
{
RevoluteJoint::RevoluteJoint(Body *body1, Body *body2, float x, float y, bool collideConnected)
RevoluteJoint::RevoluteJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected)
: Joint(body1, body2)
, joint(NULL)
{
b2RevoluteJointDef def;
def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(x,y)));
def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(xA,yA)));
def.localAnchorB = body2->body->GetLocalPoint(Physics::scaleDown(b2Vec2(xB, yB)));
def.collideConnected = collideConnected;
joint = (b2RevoluteJoint *)createJoint(&def);
}