More camera refactor
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user