Improve window drawing

This commit is contained in:
2025-10-28 09:58:44 +00:00
parent d6c4d3d609
commit 10503da955
9 changed files with 58 additions and 42 deletions
+6 -3
View File
@@ -24,6 +24,7 @@ import Dodge.Zoning.Wall
import Geometry
import LensHelp
import SDL (MouseButton (..))
import qualified SDL as SDL
{- Update the screen camera rotation and position, including any in rold scope/remote camera modifiers;
update where your avatar's view is from. -}
@@ -63,10 +64,12 @@ translateFloatingCamera theinput cam = fromMaybe cam $ do
translateFloatingCameraKeys :: Input -> Camera -> Camera
translateFloatingCameraKeys theinput cam =
cam
& camCenter -~ thetran
& camViewFrom -~ thetran
& camCenter -~ x
& camViewFrom -~ y
where
thetran = rotateV (cam ^. camRot) $ negate 10 *.* wasdDir theinput
x = rotateV (cam ^. camRot) $ negate 10 *.* wasdDir theinput
y | SDL.ScancodeLShift `M.member` (theinput ^. pressedKeys) = 0
| otherwise = x
zoomFloatingCamera :: Input -> Camera -> Camera
zoomFloatingCamera theinput