@@ -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