Implement floating camera

This commit is contained in:
2023-03-26 16:44:19 +01:00
parent 082ce9c9a1
commit 73e742e1a2
12 changed files with 86 additions and 38 deletions
+5 -2
View File
@@ -20,7 +20,7 @@ data Input = Input
{ _mousePos :: Point2 -- in pixels, from the center of the screen
, _mouseMoving :: Bool
, _pressedKeys :: M.Map Scancode PressType
, _mouseButtons :: M.Map MouseButton Bool -- shortpress False, repeatpress True
, _mouseButtons :: M.Map MouseButton Int -- counts number of frames held down
, _scrollAmount :: Int
, _previousScrollAmount :: Int
, _lLine :: (Point2, Point2)
@@ -28,7 +28,10 @@ data Input = Input
, _lrLine :: (Point2, Point2)
, _lSelect :: Point2
, _rSelect :: Point2
, _clickMousePos :: Point2
, _clickMousePos :: Point2 -- is this in world or screen coords?
, _clickPos :: M.Map MouseButton Point2 -- updates when mouse button is pressed
, _heldPos :: M.Map MouseButton Point2 -- updates when mouse button is held
-- ideally, lags ONE FRAME BEHIND the stored mouse position
, _textInput :: [Either TermSignal Char]
, _scrollTestFloat :: Float
, _scrollTestInt :: Int