Skip to content

Commit 07e8bda

Browse files
committed
add ratted to CCBReader.
1 parent e69a01c commit 07e8bda

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

cocos2d-ui/CCBReader/CCBReader.m

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,25 @@ -(void)readJoint
10001000
{
10011001
float motorRate = properties[@"motorRate"] ? [properties[@"motorRate"] floatValue] : 1.0f;
10021002
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+
10031022
}
10041023

10051024
CGPoint anchorA = [properties[@"anchorA"] CGPointValue];

0 commit comments

Comments
 (0)