hw/examples/example03/Types.hs

62 lines
1.4 KiB
Haskell
Raw Normal View History

2017-11-12 16:10:47 +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
2017-11-19 17:27:09 +00:00
data Opts = Opts
{ width :: Word
, height :: Word
}
2017-11-12 16:10:47 +00:00
data StateData = StateData
{ ship :: Ship
, vertHandles :: [Ship]
, camera :: Camera
, proj :: M44 Float
, physics :: Physics
, physicsObjects :: PhysicsObjects
, shipProgram :: GLU.ShaderProgram
, handleProgram :: GLU.ShaderProgram
2017-11-19 17:27:09 +00:00
, selHandleProgram :: GLU.ShaderProgram
2017-11-12 16:10:47 +00:00
}
data Ship = Ship
{ shipVao :: GL.VertexArrayObject
, shipVaoLen :: Int
, shipPos :: V3 Float
, shipRot :: Quaternion Float
, shipTexture :: Maybe GL.TextureObject
2017-11-16 18:48:11 +00:00
, shipUVs :: Maybe GL.BufferObject
2017-11-19 17:27:09 +00:00
} deriving (Eq)
2017-11-12 16:10:47 +00:00
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
-- { poGround :: PhysBody StaticPlaneShape
2017-11-18 10:02:55 +00:00
{ poBalls :: [PhysBody SphereShape]
2017-11-12 16:10:47 +00:00
}
data PhysBody a = PhysBody
{ bodyShape :: a
, bodyMotionState :: MotionState
, bodyRigidBody :: RigidBody
}