Skip to content

Commit 18265dd

Browse files
committed
Applying jtwigg's fix for pin joints.
Former-commit-id: cddc2d6
1 parent b580f49 commit 18265dd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cocos2d/CCPhysicsJoint.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ -(void)willAddToPhysicsNode:(CCPhysicsNode *)physics
9696
CGPoint anchorA = CGPointApplyAffineTransform(_anchorA, bodyA.node.nonRigidTransform);
9797
CGPoint anchorB = CGPointApplyAffineTransform(_anchorB, bodyB.node.nonRigidTransform);
9898

99+
_constraint.anchorA = CCP_TO_CPV(anchorA);
100+
_constraint.anchorB = CCP_TO_CPV(anchorB);
99101
_constraint.dist = cpvdist([bodyA.body localToWorld:CCP_TO_CPV(anchorA)], [bodyB.body localToWorld:CCP_TO_CPV(anchorB)]);
100102
}
101103

0 commit comments

Comments
 (0)