Zoom in when spawning
This commit is contained in:
@@ -8,6 +8,7 @@ module Dodge.Base.Window (
|
||||
pointIsOnScreen,
|
||||
) where
|
||||
|
||||
import Linear
|
||||
import Control.Lens
|
||||
import Dodge.Data.Camera
|
||||
import Dodge.Data.Config
|
||||
@@ -19,9 +20,9 @@ screenPolygon cfig w = map (scTran . scRot . scZoom) $ screenBox cfig
|
||||
where
|
||||
scRot = rotateV (w ^. camRot)
|
||||
scZoom p
|
||||
| (w ^. camZoom) /= 0 = (1 / (w ^. camZoom)) *.* p
|
||||
| (w ^. camZoom) /= 0 = (1 / (w ^. camZoom)) *^ p
|
||||
| otherwise = p
|
||||
scTran p = p +.+ (w ^. camCenter)
|
||||
scTran p = p + (w ^. camCenter)
|
||||
|
||||
-- | A box covering the screen in world coordinates, with a x and y border
|
||||
screenPolygonBord ::
|
||||
@@ -37,9 +38,9 @@ screenPolygonBord xbord ybord cfig w = [tr, tl, bl, br]
|
||||
hw = halfWidth cfig - xbord
|
||||
hh = halfHeight cfig - ybord
|
||||
scZoom p
|
||||
| (w ^. camZoom) /= 0 = (1 / (w ^. camZoom)) *.* p
|
||||
| (w ^. camZoom) /= 0 = (1 / (w ^. camZoom)) *^ p
|
||||
| otherwise = p
|
||||
theTransform = (+.+ (w ^. camCenter)) . rotateV (w ^. camRot) . scZoom
|
||||
theTransform = (+ (w ^. camCenter)) . rotateV (w ^. camRot) . scZoom
|
||||
tr = theTransform (V2 hw hh)
|
||||
tl = theTransform (V2 (- hw) hh)
|
||||
br = theTransform (V2 hw (- hh))
|
||||
|
||||
Reference in New Issue
Block a user