Skip to content

Commit 5f37659

Browse files
committed
Fixed method misspelling.
1 parent 5707baa commit 5f37659

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

cocos2d-ui/CCBReader/CCBReader.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ -(void)readJoint
12151215
float damping = properties[@"dampedSpringDamping"] ? [properties[@"dampedSpringDamping"] floatValue] : 4.0f;
12161216
damping *= 100.0f;
12171217

1218-
CCPhysicsJoint * rotarySpringJoint = [CCPhysicsJoint connectedRotarySpringJointWithBodyA:nodeBodyA.physicsBody bodyB:nodeBodyB.physicsBody restAngle:restAngle stifness:stiffness damping:damping];
1218+
CCPhysicsJoint * rotarySpringJoint = [CCPhysicsJoint connectedRotarySpringJointWithBodyA:nodeBodyA.physicsBody bodyB:nodeBodyB.physicsBody restAngle:restAngle stiffness:stiffness damping:damping];
12191219

12201220
rotarySpringJoint.maxForce = maxForce;
12211221
rotarySpringJoint.breakingForce = breakingForce;

cocos2d/CCPhysicsJoint.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ Joints cannot be reactivated once they are invalidated.
108108
*
109109
* @return The CCPhysicsJoint Object.
110110
*/
111-
+(CCPhysicsJoint *)connectedRotarySpringJointWithBodyA:(CCPhysicsBody *)bodyA bodyB:(CCPhysicsBody *)bodyB restAngle:(CGFloat)restAngle stifness:(CGFloat)stiffness damping:(CGFloat)damping;
111+
+(CCPhysicsJoint *)connectedRotarySpringJointWithBodyA:(CCPhysicsBody *)bodyA bodyB:(CCPhysicsBody *)bodyB restAngle:(CGFloat)restAngle stiffness:(CGFloat)stiffness damping:(CGFloat)damping;
112+
113+
114+
/// This method was misspelled. Please change "stifness" to "stiffness".
115+
+(CCPhysicsJoint *)connectedRotarySpringJointWithBodyA:(CCPhysicsBody *)bodyA bodyB:(CCPhysicsBody *)bodyB restAngle:(CGFloat)restAngle stifness:(CGFloat)stiffness damping:(CGFloat)damping __attribute__((deprecated));
112116

113117

114118

cocos2d/CCPhysicsJoint.m

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ -(id)initWithBodyA:(CCPhysicsBody *)bodyA bodyB:(CCPhysicsBody *)bodyB anchorA:(
4949
@end
5050

5151
@interface CCPhysicsRotarySpring : CCPhysicsJoint
52-
-(id)initWithBodyA:(CCPhysicsBody *)bodyA bodyB:(CCPhysicsBody *)bodyB restAngle:(cpFloat)restAngle stifness:(cpFloat)stiffness damping:(cpFloat)damping;
52+
-(id)initWithBodyA:(CCPhysicsBody *)bodyA bodyB:(CCPhysicsBody *)bodyB restAngle:(cpFloat)restAngle stiffness:(cpFloat)stiffness damping:(cpFloat)damping;
5353
@end
5454

5555
@interface CCPhysicsMotorJoint : CCPhysicsJoint
@@ -146,7 +146,15 @@ +(CCPhysicsJoint *)connectedRotarySpringJointWithBodyA:(CCPhysicsBody *)bodyA bo
146146
stifness:(CGFloat)stiffness
147147
damping:(CGFloat)damping
148148
{
149-
CCPhysicsRotarySpring * joint = [[CCPhysicsRotarySpring alloc] initWithBodyA:bodyA bodyB:bodyB restAngle:restAngle stifness:stiffness damping:damping];
149+
return [self connectedRotarySpringJointWithBodyA:bodyA bodyB:bodyB restAngle:restAngle stifness:stiffness damping:damping];
150+
}
151+
152+
+(CCPhysicsJoint *)connectedRotarySpringJointWithBodyA:(CCPhysicsBody *)bodyA bodyB:(CCPhysicsBody *)bodyB
153+
restAngle:(CGFloat)restAngle
154+
stiffness:(CGFloat)stiffness
155+
damping:(CGFloat)damping
156+
{
157+
CCPhysicsRotarySpring * joint = [[CCPhysicsRotarySpring alloc] initWithBodyA:bodyA bodyB:bodyB restAngle:restAngle stiffness:stiffness damping:damping];
150158

151159
[bodyA addJoint:joint];
152160
[bodyB addJoint:joint];
@@ -289,7 +297,7 @@ @implementation CCPhysicsRotarySpring{
289297

290298
}
291299

292-
-(id)initWithBodyA:(CCPhysicsBody *)bodyA bodyB:(CCPhysicsBody *)bodyB restAngle:(cpFloat)_restAngle stifness:(cpFloat)stiffness damping:(cpFloat)damping
300+
-(id)initWithBodyA:(CCPhysicsBody *)bodyA bodyB:(CCPhysicsBody *)bodyB restAngle:(cpFloat)_restAngle stiffness:(cpFloat)stiffness damping:(cpFloat)damping
293301
{
294302
if((self = [super init])){
295303
_constraint = [ChipmunkDampedRotarySpring dampedRotarySpringWithBodyA:bodyA.body bodyB:bodyB.body restAngle:_restAngle stiffness:stiffness damping:damping];

0 commit comments

Comments
 (0)