More camera refactor

This commit is contained in:
2022-10-28 21:22:44 +01:00
parent 2e7cd0aec2
commit 32744d7cb3
5 changed files with 18 additions and 13 deletions
+2 -4
View File
@@ -21,13 +21,11 @@ import Control.Lens
- These have to be scaled according to the size of the window to get actual screen positions.
- This allows for line thicknesses etc to correspond to pixel sizes.
-}
worldPosToScreen :: World -> Point2 -> Point2
worldPosToScreen w =
worldPosToScreen :: CamPos -> Point2 -> Point2
worldPosToScreen cam =
rotateV (negate $ cam ^. camRot)
. ((cam ^. camZoom) *.*)
. (-.- (cam ^. camCenter))
where
cam = w ^. cWorld . lWorld . camPos
{- | Transform coordinates from the map position to screen
coordinates.