Browse Source

Forgot to put the second anchor points in local coordinates

--HG--
branch : box2d-update
Bill Meltsner 14 years ago
parent
commit
705fa14736

+ 1 - 1
src/modules/physics/box2d/FrictionJoint.cpp

@@ -38,7 +38,7 @@ namespace box2d
 	{	
 		b2FrictionJointDef def;
 		def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(xA,yA)));
-		def.localAnchorB = Physics::scaleDown(b2Vec2(xB, yB));
+		def.localAnchorB = body2->body->GetLocalPoint(Physics::scaleDown(b2Vec2(xB, yB)));
 		def.collideConnected = collideConnected;
 		joint = (b2FrictionJoint*)createJoint(&def);
 	}

+ 1 - 1
src/modules/physics/box2d/WeldJoint.cpp

@@ -38,7 +38,7 @@ namespace box2d
 	{	
 		b2WeldJointDef def;
 		def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(xA,yA)));
-		def.localAnchorB = Physics::scaleDown(b2Vec2(xB, yB));
+		def.localAnchorB = body2->body->GetLocalPoint(Physics::scaleDown(b2Vec2(xB, yB)));
 		def.collideConnected = collideConnected;
 		joint = (b2WeldJoint*)createJoint(&def);
 	}