The coordinate system from the TMX files appears to be upside down and backwards. It requires some mathematical gymnastics to get objects positioned properly between physics and the rendering engine.
As an example,
//\Note: these need converted by /32?
//HACK!! flipping due to coordinate issues
float x, y, width, height;
x = rectPtr->getX() / 64.f - 1;
y = rectPtr->getY() / 64.f - 1;
width = rectPtr->getW() / 64.f;
height = rectPtr->getH() / 64.f;
This code is required as part of the map_physics demonstration in order to have the physics debug rectangles actually appear where they are supposed to be. The TMX parser should take care of these issues and not require the application to handle it. A standard definition of coordinate systems would make this easier.
The coordinate system from the TMX files appears to be upside down and backwards. It requires some mathematical gymnastics to get objects positioned properly between physics and the rendering engine.
As an example,
This code is required as part of the map_physics demonstration in order to have the physics debug rectangles actually appear where they are supposed to be. The TMX parser should take care of these issues and not require the application to handle it. A standard definition of coordinate systems would make this easier.