mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-17 07:01:49 +01:00
Lmao, git removed some things :>(
This commit is contained in:
@@ -25,3 +25,9 @@ Point2f Camera::TransformMouse(const Point2f& mousePos) const {
|
||||
worldPos.y = Viewport.height - worldPos.y + m_Position.y / m_Scale;
|
||||
return worldPos;
|
||||
}
|
||||
Point2f Camera::TransformWorld(const Point2f& worldPos) const {
|
||||
Point2f screenPos = worldPos;
|
||||
screenPos.x = screenPos.x * m_Scale - m_Position.x;
|
||||
screenPos.y = Viewport.height - screenPos.y * m_Scale - m_Position.y;
|
||||
return screenPos;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user