Added Wiimote support

This commit is contained in:
Matthias Schiffer 2010-04-07 13:28:38 +02:00
parent 736ad91b32
commit c0d2d54ea1
8 changed files with 76 additions and 31 deletions

View file

@ -100,10 +100,10 @@ render = do
vertex $ Vertex2 (0 :: GLfloat) (0 :: GLfloat)
forM_ tanklist $ \tank -> unsafePreservingMatrix $ do
let x = fromReal . tankX $ tank
y = fromReal . tankY $ tank
rotDir = fromReal . tankDir $ tank
rotAim = fromReal . tankAim $ tank
let x = realToFrac . tankX $ tank
y = realToFrac . tankY $ tank
rotDir = realToFrac . tankDir $ tank
rotAim = realToFrac . tankAim $ tank
translate $ Vector3 x y (0 :: GLfloat)
rotate rotDir $ Vector3 0 0 (1 :: GLfloat)
@ -141,9 +141,9 @@ render = do
vertex $ Vertex2 (0.5 :: GLfloat) (-0.5 :: GLfloat)
forM_ bulletlist $ \bullet -> unsafePreservingMatrix $ do
let x = fromReal . bulletX $ bullet
y = fromReal . bulletY $ bullet
rotDir = fromReal . bulletDir $ bullet
let x = realToFrac . bulletX $ bullet
y = realToFrac . bulletY $ bullet
rotDir = realToFrac . bulletDir $ bullet
translate $ Vector3 x y (0 :: GLfloat)
rotate rotDir $ Vector3 0 0 (1 :: GLfloat)
@ -162,7 +162,3 @@ render = do
texCoord $ TexCoord2 (1 :: GLfloat) (0 :: GLfloat)
vertex $ Vertex2 (0.1 :: GLfloat) (-0.1 :: GLfloat)
fromReal :: (Real a, Fractional b) => a -> b
fromReal = fromRational . toRational