hw/src/Types.hs

55 lines
1.2 KiB
Haskell
Raw Normal View History

2017-09-19 15:27:49 +00:00
module Types where
import qualified Graphics.Rendering.OpenGL as GL
import qualified Graphics.GLUtil as GLU
import Linear as L
import SpatialMath
import Physics.Bullet.Raw as Bullet
data StateData = StateData
2017-09-21 08:28:42 +00:00
{ ship :: Ship
2017-09-19 15:27:49 +00:00
, camera :: Camera
2017-09-29 20:06:20 +00:00
-- , proj :: M44 Float
2017-09-19 15:27:49 +00:00
, program :: GLU.ShaderProgram
, physics :: Physics
, physicsObjects :: PhysicsObjects
2017-09-29 20:06:20 +00:00
, projection :: Projection
2017-09-19 15:27:49 +00:00
}
data Ship = Ship
{ shipVao :: GL.VertexArrayObject
, shipVaoLen :: Int
, shipPos :: V3 Float
, shipRot :: Quaternion Float
}
data Camera = Camera
{ cameraFocus :: V3 Float
, cameraRot :: Euler Float
, cameraDist :: Float
}
data Physics = Physics
{ pBroadphase :: DbvtBroadphase
, pConfig :: DefaultCollisionConfiguration
, pDispatcher :: CollisionDispatcher
, pSolver :: SequentialImpulseConstraintSolver
, pWorld :: DiscreteDynamicsWorld
}
data PhysicsObjects = PhysicsObjects
2017-09-21 08:28:42 +00:00
-- { poGround :: PhysBody StaticPlaneShape
{ poBall :: PhysBody SphereShape
2017-09-19 15:27:49 +00:00
}
data PhysBody a = PhysBody
{ bodyShape :: a
, bodyMotionState :: MotionState
, bodyRigidBody :: RigidBody
}
2017-09-29 20:06:20 +00:00
data Projection = Ortho (M44 Float) | Perspective (M44 Float)