hw/examples/example02/Types.hs

58 lines
1.3 KiB
Haskell
Raw Normal View History

2017-11-07 21:22:46 +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
{ ships :: [Ship]
, planet :: Ship
2018-05-17 21:42:07 +00:00
, oplanets :: [Ship]
2017-11-07 21:22:46 +00:00
, camera :: Camera
, proj :: M44 Float
, program :: GLU.ShaderProgram
2018-05-17 21:42:07 +00:00
, program2 :: GLU.ShaderProgram
2017-11-07 21:22:46 +00:00
, physics :: Physics
, physicsObjects :: PhysicsObjects
2018-05-17 21:42:07 +00:00
, focusIndex :: Int
2017-11-07 21:22:46 +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
{ poBigBall :: PhysBody SphereShape
, poSmallBalls :: [PhysBody SphereShape]
2018-05-17 21:42:07 +00:00
, poBigBalls :: [PhysBody SphereShape]
2017-11-07 21:22:46 +00:00
}
data PhysBody a = PhysBody
{ bodyShape :: a
, bodyMotionState :: MotionState
, bodyRigidBody :: RigidBody
, bodyMass :: Double
} deriving (Eq)