Skip to content

Commit e1b607e

Browse files
author
boyu0
committed
closed cocos2d#3988: fix bug Node::setRotation() moves opposite when node has a physics body.
1 parent c455bd4 commit e1b607e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cocos/physics/CCPhysicsBody.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ void PhysicsBody::setPosition(Point position)
345345

346346
void PhysicsBody::setRotation(float rotation)
347347
{
348-
cpBodySetAngle(_info->getBody(), PhysicsHelper::float2cpfloat(rotation * M_PI / 180.0f));
348+
cpBodySetAngle(_info->getBody(), -PhysicsHelper::float2cpfloat(rotation * M_PI / 180.0f));
349349
}
350350

351351
Point PhysicsBody::getPosition() const

0 commit comments

Comments
 (0)