readability, executional verbosity and correction of y direction

This commit is contained in:
nek0 2020-08-10 12:50:29 +02:00
parent 31976ff185
commit c27d0a72e3
1 changed files with 12 additions and 15 deletions

View File

@ -1,7 +1,11 @@
module EventHandler where
import Control.Monad (when)
import Control.Concurrent.MVar
import Control.Lens as Lens
import Linear
import qualified SDL
@ -39,7 +43,7 @@ moveQuad proj view model evs =
SDL.KeycodeX ->
V3 1 0 0
SDL.KeycodeY ->
V3 0 1 0
V3 0 (-1) 0
_ ->
V3 0 0 0
)
@ -47,22 +51,15 @@ moveQuad proj view model evs =
!-!
(identity :: M44 GL.GLfloat)
in acc !+! trans
_ -> acc !+!
(V4
(V4 0 0 0 0)
(V4 0 0 0 0)
(V4 0 0 0 0)
(V4 0 0 0 0)
)
_ -> acc
)
(V4
(V4 0 0 0 0)
(V4 0 0 0 0)
(V4 0 0 0 0)
(V4 0 0 0 0)
)
zero
<$> readMVar evs
return $ mmodel !+! plusModel
let retval = mmodel !+! plusModel
when (not $ plusModel == zero) $
print ("Current Position of object: " <>
show (Lens.view translation $ retval))
return retval
)
return mview
)