Add general smooth scrolling, move camera into world
This commit is contained in:
@@ -132,7 +132,7 @@ allVisibleWalls :: World -> [(Point2, Wall)]
|
||||
{-# INLINE allVisibleWalls #-}
|
||||
allVisibleWalls w = concatMap (flip (visibleWalls vPos) w . (+.+ vPos)) $ nRays 15
|
||||
where
|
||||
vPos = w ^. cWorld . cwCam . camViewFrom
|
||||
vPos = w ^. wCam . camViewFrom
|
||||
|
||||
overlapCircWalls ::
|
||||
Point2 ->
|
||||
|
||||
@@ -15,9 +15,9 @@ import Geometry
|
||||
--worldPosToScreenNorm :: Configuration -> World -> Point2 -> Point2
|
||||
--worldPosToScreenNorm cfig w = doWindowScale cfig . doRotate . doZoom . doTranslate
|
||||
-- where
|
||||
-- doTranslate p = p -.- (w ^. cWorld . lWorld . cwCam . cwcCenter)
|
||||
-- doZoom p = (w ^. cWorld . lWorld . cwCam . cwcZoom) *.* p
|
||||
-- doRotate p = rotateV (negate (w ^. cWorld . lWorld . cwCam . cwcRot)) p
|
||||
-- doTranslate p = p -.- (w ^. cWorld . lWorld . wCam . cwcCenter)
|
||||
-- doZoom p = (w ^. cWorld . lWorld . wCam . cwcZoom) *.* p
|
||||
-- doRotate p = rotateV (negate (w ^. cWorld . lWorld . wCam . cwcRot)) p
|
||||
|
||||
{- | Transform world coordinates to scaled screen coordinates.
|
||||
- These have to be scaled according to the size of the window to get actual screen positions.
|
||||
|
||||
Reference in New Issue
Block a user