@@ -49,7 +49,7 @@ -(id)initWithBodyA:(CCPhysicsBody *)bodyA bodyB:(CCPhysicsBody *)bodyB anchorA:(
49
49
@end
50
50
51
51
@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 ;
53
53
@end
54
54
55
55
@interface CCPhysicsMotorJoint : CCPhysicsJoint
@@ -146,7 +146,15 @@ +(CCPhysicsJoint *)connectedRotarySpringJointWithBodyA:(CCPhysicsBody *)bodyA bo
146
146
stifness : (CGFloat)stiffness
147
147
damping : (CGFloat)damping
148
148
{
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];
150
158
151
159
[bodyA addJoint: joint];
152
160
[bodyB addJoint: joint];
@@ -289,7 +297,7 @@ @implementation CCPhysicsRotarySpring{
289
297
290
298
}
291
299
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
293
301
{
294
302
if ((self = [super init ])){
295
303
_constraint = [ChipmunkDampedRotarySpring dampedRotarySpringWithBodyA: bodyA.body bodyB: bodyB.body restAngle: _restAngle stiffness: stiffness damping: damping];
0 commit comments