Record aim position in LWorld

This commit is contained in:
2025-06-03 09:34:18 +01:00
parent 1de90a97f0
commit a73db304d0
9 changed files with 26 additions and 29 deletions
+4 -3
View File
@@ -1,8 +1,8 @@
module Dodge.Base.Coordinate (
mouseWorldPos,
cartePosToScreen,
worldPosToScreen,
screenToWorldPos,
mouseWorldPos',
) where
import Control.Lens
@@ -45,11 +45,12 @@ cartePosToScreen thehud = doRotate . doZoom . doTranslate
--crToMousePosOffset cr w = (mouseWorldPos w -.- _crPos cr, 0)
-- | The mouse position in world coordinates.
mouseWorldPos :: Input -> Camera -> Point2
mouseWorldPos inp cam =
mouseWorldPos' :: Input -> Camera -> Point2
mouseWorldPos' inp cam =
(cam ^. camCenter)
+.+ (1 / (cam ^. camZoom)) *.* rotateV (cam ^. camRot) (_mousePos inp)
screenToWorldPos :: Camera -> Point2 -> Point2
screenToWorldPos cam p =
(cam ^. camCenter)