Add second body anchor point to FrictionJoint/WeldJoint constructors

--HG--
branch : box2d-update
This commit is contained in:
Bill Meltsner
2011-10-02 10:06:31 -04:00
parent 735c52b228
commit f38655a934
7 changed files with 50 additions and 24 deletions
+3 -2
View File
@@ -33,11 +33,12 @@ namespace physics
{
namespace box2d
{
FrictionJoint::FrictionJoint(Body * body1, Body * body2, float x, float y, bool collideConnected)
FrictionJoint::FrictionJoint(Body * body1, Body * body2, float xA, float yA, float xB, float yB, bool collideConnected)
: Joint(body1, body2), joint(NULL)
{
b2FrictionJointDef 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 = Physics::scaleDown(b2Vec2(xB, yB));
def.collideConnected = collideConnected;
joint = (b2FrictionJoint*)createJoint(&def);
}