5.3: Box2D Coordinates and Vectors - The Nature of Code
This video covers the Box2D coordinate system and how to use the Vec2 class.
Read along: Read along: http://natureofcode.com/book/chapter-5-physics-libraries/#chapter05_section4
Convert location from World to Pixels
Vec2 coordWorldToPixels(Vec2 world)
Convert location from World to Pixels
Vec2 coordWorldToPixels(float worldX, float worldY)
Convert location from Pixels to World
Vec2 coordPixelsToWorld(Vec2 screen)
Convert location from Pixels to World
Vec2 coordPixelsToWorld(float pixelX, float pixelY)
Scale a dimension (such as height, width, or radius) from Pixels to World
float scalarPixelsToWorld(float val)
Scale a dimension from World to Pixels
float scalarWorldToPixels(float val)
Help us caption & translate this video!
http://amara.org/v/Qbvy/
📄 Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct