Start to generalise text input to "terminal signal" input
This commit is contained in:
@@ -5,7 +5,7 @@ module Dodge.Base.Coordinate (
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
import Dodge.Data.CamPos
|
||||
import Dodge.Data.Camera
|
||||
import Dodge.Data.HUD
|
||||
import Dodge.Data.Input
|
||||
import Geometry
|
||||
@@ -22,7 +22,7 @@ import Geometry
|
||||
- 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 :: CamPos -> Point2 -> Point2
|
||||
worldPosToScreen :: Camera -> Point2 -> Point2
|
||||
worldPosToScreen cam =
|
||||
rotateV (negate $ cam ^. camRot)
|
||||
. ((cam ^. camZoom) *.*)
|
||||
@@ -42,7 +42,7 @@ cartePosToScreen thehud = doRotate . doZoom . doTranslate
|
||||
--crToMousePosOffset cr w = (mouseWorldPos w -.- _crPos cr, 0)
|
||||
|
||||
-- | The mouse position in world coordinates.
|
||||
mouseWorldPos :: Input -> CamPos -> Point2
|
||||
mouseWorldPos :: Input -> Camera -> Point2
|
||||
mouseWorldPos inp cam =
|
||||
(cam ^. camCenter)
|
||||
+.+ (1 / (cam ^. camZoom)) *.* rotateV (cam ^. camRot) (_mousePos inp)
|
||||
|
||||
Reference in New Issue
Block a user