collision response rotation

hi,
My game sdk( marmalade ) will rotate objects in counterclockwise for +ve values and clockwise for -ve values and box2d does the same, i am getting opposite rotation values while collision response is happening.

for example:
if i am having static box in my middle of the screen and dynamic box is falling from upwards, and bottom right of dynamic box is colliding with top left of static box, my dynamic body is rotating in clockwise direction rather than anticlockwise and i am getting -ve values from body->getAngle() instead of +ve values.

This works fine if i am reversing the angle while applying to sprite transformation
float _x = dynamicBody->getPosition().x;
float _y = dynamicBody->getPosition().y;
float angle = dynamicBody->getAngle();

TransformSprite->rotate( -angle ); // angle applied in opposite direction.
TransformSprite->translate( _x, _y );
// orgin - top left of the screen. gravity = 10. (Box2D v2.2.0)

At first i thought my sdk(marmalade) rotation values are in opposite direction to box2d but later when i applied the follwing code.
//update
float newAngle = 1.0f; // radians
dynamicBody->setTransform( dynamicBody>getPosition(), newAngle );// box2d transformation

//render
float _x = dynamicBody->getPosition().x;
float _y = dynamicBody->getPosition().y;
float angle = dynamicBody->getAngle();

TransformSprite->rotate( angle ); // angle is same..
TransformSprite->translate( _x, _y );

// body is rotating in counterclockwise direction as i expected while using setTransform method, i dont know why my collision response is giving angle in opposite direction..
From the way you say "orgin - top left of the screen. gravity = 10" I am assuming the y-axis is reversed between marmalade and Box2D, right? If you see the box falling downwards, with gravity 10, then you must be reversing the y-coordinate to make it go downwards on the screen. But in the physics world the box is really moving upwards. So when it hits the static box, its actually the top right of the dynamic box colliding with the bottom left of the static box, which would make it rotate clockwise. So if you're going to flip the y-axis coordinates, you will also have to reverse the angles.
Thank you for replying,
flash games has their orgin at top left of the screen( y - axis downwards ) and if integrated with box2d gravity value will be +10, many of the online tutorials i had seen they are not reversing the box2d angle while applying to sprite transformations. Box2d c++ and flash coordinate system is same?..
http://blog.allanbishop.com/box2d-2-1a-tutorial-part-1/
ok, so the framework reverses the y-coordinate for you, I see. But inside the Box2D world the dynamic box is still moving upward.
I have never used Flash, but my friend google tells me a positive rotation is clockwise in Flash which would explain why it behaves the opposite way to Marmalade.
Thanks a lot for clearing my confusion on box2d coordinate system behavior, now i understood clearly about the problem..
Is their any hack in box2d source code so that i can change box2d coordinate system according to my game coordinate system( especially reversing y-axis )..
Why do you need to hack anything? As you said in your first post the problem is solved if you use the negative of the angle given by Box2D.
Happy for Ur quick response.. 😀

OK i will fix with negative angle, can i be sure that its not gonna give problem in future!

Original thread: https://box2d.org/forum/viewtopic.php?t=9460