Refactor crPos to be a V3

This commit is contained in:
2025-10-10 13:47:31 +01:00
parent 98ece551c7
commit 49fb982877
58 changed files with 375 additions and 307 deletions
+3 -2
View File
@@ -2,6 +2,7 @@
module Dodge.Render.Picture (fixedCoordPictures) where
import Linear (_xy)
import Control.Lens
import Data.Maybe
import Dodge.Base.Coordinate
@@ -116,7 +117,7 @@ mouseCursorType u = case u ^. uvWorld . input . mouseContext of
w = u ^. uvWorld
selsec = u ^? uvWorld . hud . diSelection . _Just . slSec
a = fromMaybe 0 $ do
cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos
cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos . _xy
return . toClosestMultiple (pi / 32) $
argV (w ^. cWorld . lWorld . lAimPos -.- cpos)
- w ^. wCam . camRot
@@ -293,6 +294,6 @@ drawAimSweep cr w = fold $ do
where
cdir = _crDir cr
rot = campos ^. camRot
p = _crPos cr
p = cr ^. crPos . _xy
campos = w ^. wCam
mwp = w ^. cWorld . lWorld . lAimPos