Skip to content

Commit 6b6a4ba

Browse files
committed
Merge branch 'develop-v3' of https://github.com/cocos2d/cocos2d-iphone into develop-v3
Former-commit-id: 38faadf
2 parents e8c9029 + e081ac4 commit 6b6a4ba

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

cocos2d/CCNode.m

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,12 @@ -(float) rotation
242242
}
243243

244244
-(float)rotationalSkewX {
245-
return _rotationalSkewX;
245+
CCPhysicsBody *body = GetBodyIfRunning(self);
246+
if(body){
247+
return -CC_RADIANS_TO_DEGREES(body.absoluteRadians) + NodeToPhysicsRotation(self.parent);
248+
} else {
249+
return _rotationalSkewX;
250+
}
246251
}
247252

248253
-(void) setRotationalSkewX: (float)newX
@@ -255,7 +260,12 @@ -(void) setRotationalSkewX: (float)newX
255260

256261
-(float)rotationalSkewY
257262
{
258-
return _rotationalSkewY;
263+
CCPhysicsBody *body = GetBodyIfRunning(self);
264+
if(body){
265+
return -CC_RADIANS_TO_DEGREES(body.absoluteRadians) + NodeToPhysicsRotation(self.parent);
266+
} else {
267+
return _rotationalSkewY;
268+
}
259269
}
260270

261271
-(void) setRotationalSkewY: (float)newY

0 commit comments

Comments
 (0)