Skip to content

Instantly share code, notes, and snippets.

@jrob00
Created April 6, 2012 21:16
Show Gist options
  • Save jrob00/2322998 to your computer and use it in GitHub Desktop.
Save jrob00/2322998 to your computer and use it in GitHub Desktop.
Box2d macros
#define PTM_RATIO 40.0f
#define SCREEN_TO_WORLD(n) ((n) / PTM_RATIO)
#define WORLD_TO_SCREEN(n) ((n) * PTM_RATIO)
#define B2_ANGLE_TO_COCOS_ROTATION(n) (-1 * CC_RADIANS_TO_DEGREES(n))
#define COCOS_ROTATION_TO_B2_ANGLE(n) (CC_DEGREES_TO_RADIANS(-1 * n))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment