File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1000,6 +1000,25 @@ -(void)readJoint
1000
1000
{
1001
1001
float motorRate = properties[@" motorRate" ] ? [properties[@" motorRate" ] floatValue ] : 1 .0f ;
1002
1002
CCPhysicsJoint * motorJoint = [CCPhysicsJoint connectedMotorJointWithBodyA: nodeBodyA.physicsBody bodyB: nodeBodyB.physicsBody rate: motorRate];
1003
+
1004
+ motorJoint.maxForce = maxForce;
1005
+ motorJoint.breakingForce = breakingForce;
1006
+ motorJoint.collideBodies = collideBodies;
1007
+ }
1008
+
1009
+ if ([properties[@" ratchetEnabled" ] boolValue ])
1010
+ {
1011
+ float ratchetValue = properties[@" ratchetValue" ] ? [properties[@" ratchetValue" ] floatValue ] : 30 .0f ;
1012
+ ratchetValue = CC_DEGREES_TO_RADIANS (ratchetValue);
1013
+ float ratchetPhase = properties[@" ratchetPhase" ] ? [properties[@" ratchetPhase" ] floatValue ] : 0 .0f ;
1014
+ ratchetPhase = CC_DEGREES_TO_RADIANS (ratchetPhase);
1015
+
1016
+ CCPhysicsJoint * ratchetJoint = [CCPhysicsJoint connectedRatchetJointWithBodyA: nodeBodyA.physicsBody bodyB: nodeBodyB.physicsBody phase: ratchetPhase ratchet: ratchetValue];
1017
+
1018
+ ratchetJoint.maxForce = maxForce;
1019
+ ratchetJoint.breakingForce = breakingForce;
1020
+ ratchetJoint.collideBodies = collideBodies;
1021
+
1003
1022
}
1004
1023
1005
1024
CGPoint anchorA = [properties[@" anchorA" ] CGPointValue ];
You can’t perform that action at this time.
0 commit comments