{-# LINE 1 "src/Box2D/Types.hsc" #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}

-- | Low-level bindings to the enums and configuration structs of
-- @box2d/types.h@ needed to create and configure worlds, bodies and shapes.
--
-- The @*Def@ structs carry an @internalValue@ magic that Box2D uses to detect
-- an initialised definition, so always start from the matching
-- @default*@ constructor and tweak the fields you need before use. Every C
-- @bool@ maps to 'CBool' (one byte), and opaque callback / @userData@ pointers
-- are kept as @'Ptr' ()@ until the callback layer lands.
module Box2D.Types
  ( -- * Enums
    BodyType (..)
  , pattern StaticBody
  , pattern KinematicBody
  , pattern DynamicBody
  , ShapeType (..)
  , pattern CircleShape
  , pattern CapsuleShape
  , pattern SegmentShape
  , pattern PolygonShape
  , pattern ChainSegmentShape
  , JointType (..)
  , pattern DistanceJoint
  , pattern FilterJoint
  , pattern MotorJoint
  , pattern PrismaticJoint
  , pattern RevoluteJoint
  , pattern WeldJoint
  , pattern WheelJoint

    -- * Small structs
  , Capacity (..)
  , MotionLocks (..)
  , Filter (..)
  , SurfaceMaterial (..)
  , Circle (..)
  , Capsule (..)
  , Segment (..)
  , Polygon (..)
  , Hull (..)
  , maxPolygonVertices

    -- * Definitions
  , WorldDef (..)
  , EnqueueTaskCallback
  , FinishTaskCallback
  , BodyDef (..)
  , ShapeDef (..)
  , ChainDef (..)
  , defaultChainDef
  , ExplosionDef (..)
  , defaultExplosionDef

    -- * Queries and casts
  , QueryFilter (..)
  , defaultQueryFilter
  , MassData (..)
  , RayCastInput (..)
  , CastOutput (..)
  , WorldCastOutput
  , RayResult (..)
  , TreeStats (..)
  , Sweep (..)
  , PlaneResult (..)
  , dynamicTreeByteCount

    -- * Events
  , BodyEvents (..)
  , BodyMoveEvent (..)
  , SensorEvents (..)
  , SensorBeginTouchEvent (..)
  , SensorEndTouchEvent (..)
  , ContactEvents (..)
  , ContactBeginTouchEvent (..)
  , ContactEndTouchEvent (..)
  , ContactHitEvent (..)
  , JointEvents (..)
  , JointEvent (..)

    -- * Default definitions
  , defaultWorldDef
  , defaultBodyDef
  , defaultShapeDef
  , defaultFilter
  , defaultSurfaceMaterial

    -- * Joint definitions
  , JointDef (..)
  , DistanceJointDef (..)
  , defaultDistanceJointDef
  , MotorJointDef (..)
  , defaultMotorJointDef
  , PrismaticJointDef (..)
  , defaultPrismaticJointDef
  , RevoluteJointDef (..)
  , defaultRevoluteJointDef
  , WeldJointDef (..)
  , defaultWeldJointDef
  , WheelJointDef (..)
  , defaultWheelJointDef
  , FilterJointDef (..)
  , defaultFilterJointDef
  ) where

import Foreign
import Foreign.C.String (CString)
import Foreign.C.Types (CBool, CInt)

import Box2D.Id (BodyId, ContactId, JointId, ShapeId)
import Data.Vector.Storable qualified as VS

import Box2D.Internal (allocaOut, copyVector)
import Box2D.MathTypes (Plane, Pos, Rot, Transform, Vec2)
import Box2D.Tags (FrictionCallback, RestitutionCallback)



-- Enums -------------------------------------------------------------------

-- | The body simulation type.
newtype BodyType = BodyType CInt
  deriving (BodyType -> BodyType -> Bool
(BodyType -> BodyType -> Bool)
-> (BodyType -> BodyType -> Bool) -> Eq BodyType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BodyType -> BodyType -> Bool
== :: BodyType -> BodyType -> Bool
$c/= :: BodyType -> BodyType -> Bool
/= :: BodyType -> BodyType -> Bool
Eq, Int -> BodyType -> ShowS
[BodyType] -> ShowS
BodyType -> String
(Int -> BodyType -> ShowS)
-> (BodyType -> String) -> ([BodyType] -> ShowS) -> Show BodyType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BodyType -> ShowS
showsPrec :: Int -> BodyType -> ShowS
$cshow :: BodyType -> String
show :: BodyType -> String
$cshowList :: [BodyType] -> ShowS
showList :: [BodyType] -> ShowS
Show, Ptr BodyType -> IO BodyType
Ptr BodyType -> Int -> IO BodyType
Ptr BodyType -> Int -> BodyType -> IO ()
Ptr BodyType -> BodyType -> IO ()
BodyType -> Int
(BodyType -> Int)
-> (BodyType -> Int)
-> (Ptr BodyType -> Int -> IO BodyType)
-> (Ptr BodyType -> Int -> BodyType -> IO ())
-> (forall b. Ptr b -> Int -> IO BodyType)
-> (forall b. Ptr b -> Int -> BodyType -> IO ())
-> (Ptr BodyType -> IO BodyType)
-> (Ptr BodyType -> BodyType -> IO ())
-> Storable BodyType
forall b. Ptr b -> Int -> IO BodyType
forall b. Ptr b -> Int -> BodyType -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: BodyType -> Int
sizeOf :: BodyType -> Int
$calignment :: BodyType -> Int
alignment :: BodyType -> Int
$cpeekElemOff :: Ptr BodyType -> Int -> IO BodyType
peekElemOff :: Ptr BodyType -> Int -> IO BodyType
$cpokeElemOff :: Ptr BodyType -> Int -> BodyType -> IO ()
pokeElemOff :: Ptr BodyType -> Int -> BodyType -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO BodyType
peekByteOff :: forall b. Ptr b -> Int -> IO BodyType
$cpokeByteOff :: forall b. Ptr b -> Int -> BodyType -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> BodyType -> IO ()
$cpeek :: Ptr BodyType -> IO BodyType
peek :: Ptr BodyType -> IO BodyType
$cpoke :: Ptr BodyType -> BodyType -> IO ()
poke :: Ptr BodyType -> BodyType -> IO ()
Storable)

pattern StaticBody :: BodyType
pattern KinematicBody :: BodyType
pattern DynamicBody :: BodyType
pattern $mStaticBody :: forall {r}. BodyType -> ((# #) -> r) -> ((# #) -> r) -> r
$bStaticBody :: BodyType
StaticBody = BodyType 0
{-# LINE 131 "src/Box2D/Types.hsc" #-}
pattern KinematicBody = BodyType 1
{-# LINE 132 "src/Box2D/Types.hsc" #-}
pattern DynamicBody = BodyType 2
{-# LINE 133 "src/Box2D/Types.hsc" #-}

{-# COMPLETE StaticBody, KinematicBody, DynamicBody #-}

-- | Shape geometry type.
newtype ShapeType = ShapeType CInt
  deriving (ShapeType -> ShapeType -> Bool
(ShapeType -> ShapeType -> Bool)
-> (ShapeType -> ShapeType -> Bool) -> Eq ShapeType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ShapeType -> ShapeType -> Bool
== :: ShapeType -> ShapeType -> Bool
$c/= :: ShapeType -> ShapeType -> Bool
/= :: ShapeType -> ShapeType -> Bool
Eq, Int -> ShapeType -> ShowS
[ShapeType] -> ShowS
ShapeType -> String
(Int -> ShapeType -> ShowS)
-> (ShapeType -> String)
-> ([ShapeType] -> ShowS)
-> Show ShapeType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ShapeType -> ShowS
showsPrec :: Int -> ShapeType -> ShowS
$cshow :: ShapeType -> String
show :: ShapeType -> String
$cshowList :: [ShapeType] -> ShowS
showList :: [ShapeType] -> ShowS
Show, Ptr ShapeType -> IO ShapeType
Ptr ShapeType -> Int -> IO ShapeType
Ptr ShapeType -> Int -> ShapeType -> IO ()
Ptr ShapeType -> ShapeType -> IO ()
ShapeType -> Int
(ShapeType -> Int)
-> (ShapeType -> Int)
-> (Ptr ShapeType -> Int -> IO ShapeType)
-> (Ptr ShapeType -> Int -> ShapeType -> IO ())
-> (forall b. Ptr b -> Int -> IO ShapeType)
-> (forall b. Ptr b -> Int -> ShapeType -> IO ())
-> (Ptr ShapeType -> IO ShapeType)
-> (Ptr ShapeType -> ShapeType -> IO ())
-> Storable ShapeType
forall b. Ptr b -> Int -> IO ShapeType
forall b. Ptr b -> Int -> ShapeType -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: ShapeType -> Int
sizeOf :: ShapeType -> Int
$calignment :: ShapeType -> Int
alignment :: ShapeType -> Int
$cpeekElemOff :: Ptr ShapeType -> Int -> IO ShapeType
peekElemOff :: Ptr ShapeType -> Int -> IO ShapeType
$cpokeElemOff :: Ptr ShapeType -> Int -> ShapeType -> IO ()
pokeElemOff :: Ptr ShapeType -> Int -> ShapeType -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO ShapeType
peekByteOff :: forall b. Ptr b -> Int -> IO ShapeType
$cpokeByteOff :: forall b. Ptr b -> Int -> ShapeType -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> ShapeType -> IO ()
$cpeek :: Ptr ShapeType -> IO ShapeType
peek :: Ptr ShapeType -> IO ShapeType
$cpoke :: Ptr ShapeType -> ShapeType -> IO ()
poke :: Ptr ShapeType -> ShapeType -> IO ()
Storable)

pattern CircleShape :: ShapeType
pattern CapsuleShape :: ShapeType
pattern SegmentShape :: ShapeType
pattern PolygonShape :: ShapeType
pattern ChainSegmentShape :: ShapeType
pattern $mCircleShape :: forall {r}. ShapeType -> ((# #) -> r) -> ((# #) -> r) -> r
$bCircleShape :: ShapeType
CircleShape = ShapeType 0
{-# LINE 146 "src/Box2D/Types.hsc" #-}
pattern CapsuleShape = ShapeType 1
{-# LINE 147 "src/Box2D/Types.hsc" #-}
pattern SegmentShape = ShapeType 2
{-# LINE 148 "src/Box2D/Types.hsc" #-}
pattern PolygonShape = ShapeType 3
{-# LINE 149 "src/Box2D/Types.hsc" #-}
pattern ChainSegmentShape = ShapeType 4
{-# LINE 150 "src/Box2D/Types.hsc" #-}

{-# COMPLETE CircleShape, CapsuleShape, SegmentShape, PolygonShape, ChainSegmentShape #-}

-- | Joint type.
newtype JointType = JointType CInt
  deriving (JointType -> JointType -> Bool
(JointType -> JointType -> Bool)
-> (JointType -> JointType -> Bool) -> Eq JointType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JointType -> JointType -> Bool
== :: JointType -> JointType -> Bool
$c/= :: JointType -> JointType -> Bool
/= :: JointType -> JointType -> Bool
Eq, Int -> JointType -> ShowS
[JointType] -> ShowS
JointType -> String
(Int -> JointType -> ShowS)
-> (JointType -> String)
-> ([JointType] -> ShowS)
-> Show JointType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> JointType -> ShowS
showsPrec :: Int -> JointType -> ShowS
$cshow :: JointType -> String
show :: JointType -> String
$cshowList :: [JointType] -> ShowS
showList :: [JointType] -> ShowS
Show, Ptr JointType -> IO JointType
Ptr JointType -> Int -> IO JointType
Ptr JointType -> Int -> JointType -> IO ()
Ptr JointType -> JointType -> IO ()
JointType -> Int
(JointType -> Int)
-> (JointType -> Int)
-> (Ptr JointType -> Int -> IO JointType)
-> (Ptr JointType -> Int -> JointType -> IO ())
-> (forall b. Ptr b -> Int -> IO JointType)
-> (forall b. Ptr b -> Int -> JointType -> IO ())
-> (Ptr JointType -> IO JointType)
-> (Ptr JointType -> JointType -> IO ())
-> Storable JointType
forall b. Ptr b -> Int -> IO JointType
forall b. Ptr b -> Int -> JointType -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: JointType -> Int
sizeOf :: JointType -> Int
$calignment :: JointType -> Int
alignment :: JointType -> Int
$cpeekElemOff :: Ptr JointType -> Int -> IO JointType
peekElemOff :: Ptr JointType -> Int -> IO JointType
$cpokeElemOff :: Ptr JointType -> Int -> JointType -> IO ()
pokeElemOff :: Ptr JointType -> Int -> JointType -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO JointType
peekByteOff :: forall b. Ptr b -> Int -> IO JointType
$cpokeByteOff :: forall b. Ptr b -> Int -> JointType -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> JointType -> IO ()
$cpeek :: Ptr JointType -> IO JointType
peek :: Ptr JointType -> IO JointType
$cpoke :: Ptr JointType -> JointType -> IO ()
poke :: Ptr JointType -> JointType -> IO ()
Storable)

pattern DistanceJoint :: JointType
pattern FilterJoint :: JointType
pattern MotorJoint :: JointType
pattern PrismaticJoint :: JointType
pattern RevoluteJoint :: JointType
pattern WeldJoint :: JointType
pattern WheelJoint :: JointType
pattern $mDistanceJoint :: forall {r}. JointType -> ((# #) -> r) -> ((# #) -> r) -> r
$bDistanceJoint :: JointType
DistanceJoint = JointType 0
{-# LINE 165 "src/Box2D/Types.hsc" #-}
pattern FilterJoint = JointType 1
{-# LINE 166 "src/Box2D/Types.hsc" #-}
pattern MotorJoint = JointType 2
{-# LINE 167 "src/Box2D/Types.hsc" #-}
pattern PrismaticJoint = JointType 3
{-# LINE 168 "src/Box2D/Types.hsc" #-}
pattern RevoluteJoint = JointType 4
{-# LINE 169 "src/Box2D/Types.hsc" #-}
pattern WeldJoint = JointType 5
{-# LINE 170 "src/Box2D/Types.hsc" #-}
pattern WheelJoint = JointType 6
{-# LINE 171 "src/Box2D/Types.hsc" #-}

{-# COMPLETE DistanceJoint, FilterJoint, MotorJoint, PrismaticJoint, RevoluteJoint, WeldJoint, WheelJoint #-}

-- Small structs -----------------------------------------------------------

-- | Optional world capacities used to avoid run-time allocations.
data Capacity = Capacity
  { Capacity -> CInt
capacityStaticShapeCount  :: CInt
  , Capacity -> CInt
capacityDynamicShapeCount :: CInt
  , Capacity -> CInt
capacityStaticBodyCount   :: CInt
  , Capacity -> CInt
capacityDynamicBodyCount  :: CInt
  , Capacity -> CInt
capacityContactCount      :: CInt
  }
  deriving (Capacity -> Capacity -> Bool
(Capacity -> Capacity -> Bool)
-> (Capacity -> Capacity -> Bool) -> Eq Capacity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Capacity -> Capacity -> Bool
== :: Capacity -> Capacity -> Bool
$c/= :: Capacity -> Capacity -> Bool
/= :: Capacity -> Capacity -> Bool
Eq, Int -> Capacity -> ShowS
[Capacity] -> ShowS
Capacity -> String
(Int -> Capacity -> ShowS)
-> (Capacity -> String) -> ([Capacity] -> ShowS) -> Show Capacity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Capacity -> ShowS
showsPrec :: Int -> Capacity -> ShowS
$cshow :: Capacity -> String
show :: Capacity -> String
$cshowList :: [Capacity] -> ShowS
showList :: [Capacity] -> ShowS
Show)

instance Storable Capacity where
  sizeOf :: Capacity -> Int
sizeOf Capacity
_ = (Int
20)
{-# LINE 188 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 189 "src/Box2D/Types.hsc" #-}
  peek p =
    Capacity
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 192 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 4) p
{-# LINE 193 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 194 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 12) p
{-# LINE 195 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 196 "src/Box2D/Types.hsc" #-}
  poke p (Capacity ss ds sb db c) = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p ss
{-# LINE 198 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 4) p ds
{-# LINE 199 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p sb
{-# LINE 200 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 12) p db
{-# LINE 201 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p c
{-# LINE 202 "src/Box2D/Types.hsc" #-}

-- | Per-axis translation and rotation locks for a body.
data MotionLocks = MotionLocks
  { MotionLocks -> CBool
motionLocksLinearX  :: CBool
  , MotionLocks -> CBool
motionLocksLinearY  :: CBool
  , MotionLocks -> CBool
motionLocksAngularZ :: CBool
  }
  deriving (MotionLocks -> MotionLocks -> Bool
(MotionLocks -> MotionLocks -> Bool)
-> (MotionLocks -> MotionLocks -> Bool) -> Eq MotionLocks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MotionLocks -> MotionLocks -> Bool
== :: MotionLocks -> MotionLocks -> Bool
$c/= :: MotionLocks -> MotionLocks -> Bool
/= :: MotionLocks -> MotionLocks -> Bool
Eq, Int -> MotionLocks -> ShowS
[MotionLocks] -> ShowS
MotionLocks -> String
(Int -> MotionLocks -> ShowS)
-> (MotionLocks -> String)
-> ([MotionLocks] -> ShowS)
-> Show MotionLocks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MotionLocks -> ShowS
showsPrec :: Int -> MotionLocks -> ShowS
$cshow :: MotionLocks -> String
show :: MotionLocks -> String
$cshowList :: [MotionLocks] -> ShowS
showList :: [MotionLocks] -> ShowS
Show)

instance Storable MotionLocks where
  sizeOf :: MotionLocks -> Int
sizeOf MotionLocks
_ = (Int
3)
{-# LINE 213 "src/Box2D/Types.hsc" #-}
  alignment _ = 1
{-# LINE 214 "src/Box2D/Types.hsc" #-}
  peek p =
    MotionLocks
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 217 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 1) p
{-# LINE 218 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 2) p
{-# LINE 219 "src/Box2D/Types.hsc" #-}
  poke p (MotionLocks lx ly az) = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p lx
{-# LINE 221 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 1) p ly
{-# LINE 222 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 2) p az
{-# LINE 223 "src/Box2D/Types.hsc" #-}

-- | Collision filtering data.
data Filter = Filter
  { Filter -> Word64
filterCategoryBits :: Word64
  , Filter -> Word64
filterMaskBits     :: Word64
  , Filter -> CInt
filterGroupIndex   :: CInt
  }
  deriving (Filter -> Filter -> Bool
(Filter -> Filter -> Bool)
-> (Filter -> Filter -> Bool) -> Eq Filter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Filter -> Filter -> Bool
== :: Filter -> Filter -> Bool
$c/= :: Filter -> Filter -> Bool
/= :: Filter -> Filter -> Bool
Eq, Int -> Filter -> ShowS
[Filter] -> ShowS
Filter -> String
(Int -> Filter -> ShowS)
-> (Filter -> String) -> ([Filter] -> ShowS) -> Show Filter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Filter -> ShowS
showsPrec :: Int -> Filter -> ShowS
$cshow :: Filter -> String
show :: Filter -> String
$cshowList :: [Filter] -> ShowS
showList :: [Filter] -> ShowS
Show)

instance Storable Filter where
  sizeOf :: Filter -> Int
sizeOf Filter
_ = (Int
24)
{-# LINE 234 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 235 "src/Box2D/Types.hsc" #-}
  peek p =
    Filter
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 238 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 239 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 240 "src/Box2D/Types.hsc" #-}
  poke p (Filter c m g) = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p c
{-# LINE 242 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p m
{-# LINE 243 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p g
{-# LINE 244 "src/Box2D/Types.hsc" #-}

-- | Per-surface material properties.
data SurfaceMaterial = SurfaceMaterial
  { SurfaceMaterial -> Float
surfaceMaterialFriction          :: Float
  , SurfaceMaterial -> Float
surfaceMaterialRestitution       :: Float
  , SurfaceMaterial -> Float
surfaceMaterialRollingResistance :: Float
  , SurfaceMaterial -> Float
surfaceMaterialTangentSpeed      :: Float
  , SurfaceMaterial -> Word64
surfaceMaterialUserMaterialId    :: Word64
  , SurfaceMaterial -> Word32
surfaceMaterialCustomColor       :: Word32
  }
  deriving (SurfaceMaterial -> SurfaceMaterial -> Bool
(SurfaceMaterial -> SurfaceMaterial -> Bool)
-> (SurfaceMaterial -> SurfaceMaterial -> Bool)
-> Eq SurfaceMaterial
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SurfaceMaterial -> SurfaceMaterial -> Bool
== :: SurfaceMaterial -> SurfaceMaterial -> Bool
$c/= :: SurfaceMaterial -> SurfaceMaterial -> Bool
/= :: SurfaceMaterial -> SurfaceMaterial -> Bool
Eq, Int -> SurfaceMaterial -> ShowS
[SurfaceMaterial] -> ShowS
SurfaceMaterial -> String
(Int -> SurfaceMaterial -> ShowS)
-> (SurfaceMaterial -> String)
-> ([SurfaceMaterial] -> ShowS)
-> Show SurfaceMaterial
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SurfaceMaterial -> ShowS
showsPrec :: Int -> SurfaceMaterial -> ShowS
$cshow :: SurfaceMaterial -> String
show :: SurfaceMaterial -> String
$cshowList :: [SurfaceMaterial] -> ShowS
showList :: [SurfaceMaterial] -> ShowS
Show)

instance Storable SurfaceMaterial where
  sizeOf :: SurfaceMaterial -> Int
sizeOf SurfaceMaterial
_ = (Int
32)
{-# LINE 258 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 259 "src/Box2D/Types.hsc" #-}
  peek p =
    SurfaceMaterial
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 262 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 4) p
{-# LINE 263 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 264 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 12) p
{-# LINE 265 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 266 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 24) p
{-# LINE 267 "src/Box2D/Types.hsc" #-}
  poke p (SurfaceMaterial f r rr ts umi cc) = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p f
{-# LINE 269 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 4) p r
{-# LINE 270 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p rr
{-# LINE 271 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 12) p ts
{-# LINE 272 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p umi
{-# LINE 273 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 24) p cc
{-# LINE 274 "src/Box2D/Types.hsc" #-}

-- | A solid circle with a local center offset.
data Circle = Circle
  { Circle -> Vec2
circleCenter :: Vec2
  , Circle -> Float
circleRadius :: Float
  }
  deriving (Circle -> Circle -> Bool
(Circle -> Circle -> Bool)
-> (Circle -> Circle -> Bool) -> Eq Circle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Circle -> Circle -> Bool
== :: Circle -> Circle -> Bool
$c/= :: Circle -> Circle -> Bool
/= :: Circle -> Circle -> Bool
Eq, Int -> Circle -> ShowS
[Circle] -> ShowS
Circle -> String
(Int -> Circle -> ShowS)
-> (Circle -> String) -> ([Circle] -> ShowS) -> Show Circle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Circle -> ShowS
showsPrec :: Int -> Circle -> ShowS
$cshow :: Circle -> String
show :: Circle -> String
$cshowList :: [Circle] -> ShowS
showList :: [Circle] -> ShowS
Show)

instance Storable Circle where
  sizeOf :: Circle -> Int
sizeOf Circle
_ = (Int
12)
{-# LINE 284 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 285 "src/Box2D/Types.hsc" #-}
  peek p = Circle <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 286 "src/Box2D/Types.hsc" #-}
  poke p (Circle c r) = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p c
{-# LINE 288 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p r
{-# LINE 289 "src/Box2D/Types.hsc" #-}

-- | A solid capsule: an extruded circle between two semicircle centers.
data Capsule = Capsule
  { Capsule -> Vec2
capsuleCenter1 :: Vec2
  , Capsule -> Vec2
capsuleCenter2 :: Vec2
  , Capsule -> Float
capsuleRadius  :: Float
  }
  deriving (Capsule -> Capsule -> Bool
(Capsule -> Capsule -> Bool)
-> (Capsule -> Capsule -> Bool) -> Eq Capsule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Capsule -> Capsule -> Bool
== :: Capsule -> Capsule -> Bool
$c/= :: Capsule -> Capsule -> Bool
/= :: Capsule -> Capsule -> Bool
Eq, Int -> Capsule -> ShowS
[Capsule] -> ShowS
Capsule -> String
(Int -> Capsule -> ShowS)
-> (Capsule -> String) -> ([Capsule] -> ShowS) -> Show Capsule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Capsule -> ShowS
showsPrec :: Int -> Capsule -> ShowS
$cshow :: Capsule -> String
show :: Capsule -> String
$cshowList :: [Capsule] -> ShowS
showList :: [Capsule] -> ShowS
Show)

instance Storable Capsule where
  sizeOf :: Capsule -> Int
sizeOf Capsule
_ = (Int
20)
{-# LINE 300 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 301 "src/Box2D/Types.hsc" #-}
  peek p =
    Capsule
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 304 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 305 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 306 "src/Box2D/Types.hsc" #-}
  poke p (Capsule c1 c2 r) = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p c1
{-# LINE 308 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p c2
{-# LINE 309 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p r
{-# LINE 310 "src/Box2D/Types.hsc" #-}

-- | A two-sided line segment.
data Segment = Segment
  { Segment -> Vec2
segmentPoint1 :: Vec2
  , Segment -> Vec2
segmentPoint2 :: Vec2
  }
  deriving (Segment -> Segment -> Bool
(Segment -> Segment -> Bool)
-> (Segment -> Segment -> Bool) -> Eq Segment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Segment -> Segment -> Bool
== :: Segment -> Segment -> Bool
$c/= :: Segment -> Segment -> Bool
/= :: Segment -> Segment -> Bool
Eq, Int -> Segment -> ShowS
[Segment] -> ShowS
Segment -> String
(Int -> Segment -> ShowS)
-> (Segment -> String) -> ([Segment] -> ShowS) -> Show Segment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Segment -> ShowS
showsPrec :: Int -> Segment -> ShowS
$cshow :: Segment -> String
show :: Segment -> String
$cshowList :: [Segment] -> ShowS
showList :: [Segment] -> ShowS
Show)

instance Storable Segment where
  sizeOf :: Segment -> Int
sizeOf Segment
_ = (Int
16)
{-# LINE 320 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 321 "src/Box2D/Types.hsc" #-}
  peek p = Segment <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 322 "src/Box2D/Types.hsc" #-}
  poke p (Segment p1 p2) = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p p1
{-# LINE 324 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p p2
{-# LINE 325 "src/Box2D/Types.hsc" #-}

-- | The maximum number of vertices on a convex polygon
-- (@B2_MAX_POLYGON_VERTICES@). 'Polygon' and 'Hull' reserve this many slots
-- regardless of their count.
maxPolygonVertices :: Int
maxPolygonVertices :: Int
maxPolygonVertices = Int
8
{-# LINE 331 "src/Box2D/Types.hsc" #-}

-- | A solid convex polygon with an optional rounding radius, up to
-- 'maxPolygonVertices' vertices. The engine expects consistent vertices,
-- normals and centroid, so build values with @Box2D.Collision.makeBox@,
-- @makePolygon@ (from a 'Hull') and friends rather than by hand.
--
-- The vector fields carry the struct's @count@: both must have the same
-- length, and anything past 'maxPolygonVertices' is dropped on 'poke'.
data Polygon = Polygon
  { Polygon -> Vector Vec2
polygonVertices :: VS.Vector Vec2
  , Polygon -> Vector Vec2
polygonNormals  :: VS.Vector Vec2
  , Polygon -> Vec2
polygonCentroid :: Vec2
  , Polygon -> Float
polygonRadius   :: Float
  }
  deriving (Polygon -> Polygon -> Bool
(Polygon -> Polygon -> Bool)
-> (Polygon -> Polygon -> Bool) -> Eq Polygon
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Polygon -> Polygon -> Bool
== :: Polygon -> Polygon -> Bool
$c/= :: Polygon -> Polygon -> Bool
/= :: Polygon -> Polygon -> Bool
Eq, Int -> Polygon -> ShowS
[Polygon] -> ShowS
Polygon -> String
(Int -> Polygon -> ShowS)
-> (Polygon -> String) -> ([Polygon] -> ShowS) -> Show Polygon
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Polygon -> ShowS
showsPrec :: Int -> Polygon -> ShowS
$cshow :: Polygon -> String
show :: Polygon -> String
$cshowList :: [Polygon] -> ShowS
showList :: [Polygon] -> ShowS
Show)

instance Storable Polygon where
  sizeOf :: Polygon -> Int
sizeOf Polygon
_ = (Int
144)
{-# LINE 349 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 350 "src/Box2D/Types.hsc" #-}
  peek p = do
    n <- (\hsc_ptr -> peekByteOff hsc_ptr 140) p
{-# LINE 352 "src/Box2D/Types.hsc" #-}
    Polygon
      <$> copyVector (fromIntegral (n :: CInt)) ((\hsc_ptr -> hsc_ptr `plusPtr` 0) p)
{-# LINE 354 "src/Box2D/Types.hsc" #-}
      <*> copyVector (fromIntegral n) ((\hsc_ptr -> hsc_ptr `plusPtr` 64) p)
{-# LINE 355 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 128) p
{-# LINE 356 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 136) p
{-# LINE 357 "src/Box2D/Types.hsc" #-}
  poke p x = do
    let
      vs = VS.take maxPolygonVertices (polygonVertices x)
      copyInto dst v = VS.unsafeWith v $ \src -> copyArray dst src (VS.length v)
    copyInto ((\hsc_ptr -> hsc_ptr `plusPtr` 0) p) vs
{-# LINE 362 "src/Box2D/Types.hsc" #-}
    copyInto ((\hsc_ptr -> hsc_ptr `plusPtr` 64) p) (VS.take maxPolygonVertices (polygonNormals x))
{-# LINE 363 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 128) p (polygonCentroid x)
{-# LINE 364 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 136) p (polygonRadius x)
{-# LINE 365 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 140) p (fromIntegral (VS.length vs) :: CInt)
{-# LINE 366 "src/Box2D/Types.hsc" #-}

-- | A convex hull of up to 'maxPolygonVertices' points. Compute with
-- @Box2D.Collision.computeHull@ (which validates and welds the input) rather
-- than by hand; anything past 'maxPolygonVertices' is dropped on 'poke'.
newtype Hull = Hull
  { Hull -> Vector Vec2
hullPoints :: VS.Vector Vec2
  }
  deriving (Hull -> Hull -> Bool
(Hull -> Hull -> Bool) -> (Hull -> Hull -> Bool) -> Eq Hull
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Hull -> Hull -> Bool
== :: Hull -> Hull -> Bool
$c/= :: Hull -> Hull -> Bool
/= :: Hull -> Hull -> Bool
Eq, Int -> Hull -> ShowS
[Hull] -> ShowS
Hull -> String
(Int -> Hull -> ShowS)
-> (Hull -> String) -> ([Hull] -> ShowS) -> Show Hull
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Hull -> ShowS
showsPrec :: Int -> Hull -> ShowS
$cshow :: Hull -> String
show :: Hull -> String
$cshowList :: [Hull] -> ShowS
showList :: [Hull] -> ShowS
Show)

instance Storable Hull where
  sizeOf :: Hull -> Int
sizeOf Hull
_ = (Int
68)
{-# LINE 377 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 378 "src/Box2D/Types.hsc" #-}
  peek p = do
    n <- (\hsc_ptr -> peekByteOff hsc_ptr 64) p
{-# LINE 380 "src/Box2D/Types.hsc" #-}
    Hull <$> copyVector (fromIntegral (n :: CInt)) ((\hsc_ptr -> hsc_ptr `plusPtr` 0) p)
{-# LINE 381 "src/Box2D/Types.hsc" #-}
  poke p x = do
    let ps = VS.take maxPolygonVertices (hullPoints x)
    VS.unsafeWith ps $ \src -> copyArray ((\hsc_ptr -> hsc_ptr `plusPtr` 0) p) src (VS.length ps)
{-# LINE 384 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 64) p (fromIntegral (VS.length ps) :: CInt)
{-# LINE 385 "src/Box2D/Types.hsc" #-}

-- Definitions -------------------------------------------------------------

-- | Phantom tags for the task-system callbacks stored on 'WorldDef'. These
-- typedefs never appear in API signatures, so "Box2D.Tags" carries no tag for
-- them; produce values with 'Box2D.Callbacks.withThreadPoolTaskSystem'.
data EnqueueTaskCallback
data FinishTaskCallback

-- | World creation definition. Initialise with 'defaultWorldDef'.
data WorldDef = WorldDef
  { WorldDef -> Vec2
worldDefGravity                :: Vec2
  , WorldDef -> Float
worldDefRestitutionThreshold   :: Float
  , WorldDef -> Float
worldDefHitEventThreshold      :: Float
  , WorldDef -> Float
worldDefContactHertz           :: Float
  , WorldDef -> Float
worldDefContactDampingRatio    :: Float
  , WorldDef -> Float
worldDefContactSpeed           :: Float
  , WorldDef -> Float
worldDefMaximumLinearSpeed     :: Float
  , WorldDef -> FunPtr FrictionCallback
worldDefFrictionCallback       :: FunPtr FrictionCallback
  , WorldDef -> FunPtr RestitutionCallback
worldDefRestitutionCallback    :: FunPtr RestitutionCallback
  , WorldDef -> CBool
worldDefEnableSleep            :: CBool
  , WorldDef -> CBool
worldDefEnableContinuous       :: CBool
  , WorldDef -> CBool
worldDefEnableContactSoftening :: CBool
  , WorldDef -> CInt
worldDefWorkerCount            :: CInt
  , WorldDef -> FunPtr EnqueueTaskCallback
worldDefEnqueueTask            :: FunPtr EnqueueTaskCallback
  , WorldDef -> FunPtr FinishTaskCallback
worldDefFinishTask             :: FunPtr FinishTaskCallback
  , WorldDef -> Ptr ()
worldDefUserTaskContext        :: Ptr ()
  , WorldDef -> Ptr ()
worldDefUserData               :: Ptr ()
  , WorldDef -> Capacity
worldDefCapacity               :: Capacity
  , WorldDef -> CInt
worldDefInternalValue          :: CInt
  }
  deriving (WorldDef -> WorldDef -> Bool
(WorldDef -> WorldDef -> Bool)
-> (WorldDef -> WorldDef -> Bool) -> Eq WorldDef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WorldDef -> WorldDef -> Bool
== :: WorldDef -> WorldDef -> Bool
$c/= :: WorldDef -> WorldDef -> Bool
/= :: WorldDef -> WorldDef -> Bool
Eq, Int -> WorldDef -> ShowS
[WorldDef] -> ShowS
WorldDef -> String
(Int -> WorldDef -> ShowS)
-> (WorldDef -> String) -> ([WorldDef] -> ShowS) -> Show WorldDef
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WorldDef -> ShowS
showsPrec :: Int -> WorldDef -> ShowS
$cshow :: WorldDef -> String
show :: WorldDef -> String
$cshowList :: [WorldDef] -> ShowS
showList :: [WorldDef] -> ShowS
Show)

instance Storable WorldDef where
  sizeOf :: WorldDef -> Int
sizeOf WorldDef
_ = (Int
112)
{-# LINE 420 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 421 "src/Box2D/Types.hsc" #-}
  peek p =
    WorldDef
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 424 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 425 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 12) p
{-# LINE 426 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 427 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 20) p
{-# LINE 428 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 24) p
{-# LINE 429 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 28) p
{-# LINE 430 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 32) p
{-# LINE 431 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 40) p
{-# LINE 432 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 48) p
{-# LINE 433 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 49) p
{-# LINE 434 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 50) p
{-# LINE 435 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 52) p
{-# LINE 436 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 56) p
{-# LINE 437 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 64) p
{-# LINE 438 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 72) p
{-# LINE 439 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 80) p
{-# LINE 440 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 88) p
{-# LINE 441 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 108) p
{-# LINE 442 "src/Box2D/Types.hsc" #-}
  poke p d = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (worldDefGravity d)
{-# LINE 444 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (worldDefRestitutionThreshold d)
{-# LINE 445 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 12) p (worldDefHitEventThreshold d)
{-# LINE 446 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p (worldDefContactHertz d)
{-# LINE 447 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 20) p (worldDefContactDampingRatio d)
{-# LINE 448 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 24) p (worldDefContactSpeed d)
{-# LINE 449 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 28) p (worldDefMaximumLinearSpeed d)
{-# LINE 450 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 32) p (worldDefFrictionCallback d)
{-# LINE 451 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 40) p (worldDefRestitutionCallback d)
{-# LINE 452 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 48) p (worldDefEnableSleep d)
{-# LINE 453 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 49) p (worldDefEnableContinuous d)
{-# LINE 454 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 50) p (worldDefEnableContactSoftening d)
{-# LINE 455 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 52) p (worldDefWorkerCount d)
{-# LINE 456 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 56) p (worldDefEnqueueTask d)
{-# LINE 457 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 64) p (worldDefFinishTask d)
{-# LINE 458 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 72) p (worldDefUserTaskContext d)
{-# LINE 459 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 80) p (worldDefUserData d)
{-# LINE 460 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 88) p (worldDefCapacity d)
{-# LINE 461 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 108) p (worldDefInternalValue d)
{-# LINE 462 "src/Box2D/Types.hsc" #-}

-- | Rigid body creation definition. Initialise with 'defaultBodyDef'.
data BodyDef = BodyDef
  { BodyDef -> BodyType
bodyDefType                   :: BodyType
  , BodyDef -> Vec2
bodyDefPosition               :: Pos
  , BodyDef -> Rot
bodyDefRotation               :: Rot
  , BodyDef -> Vec2
bodyDefLinearVelocity         :: Vec2
  , BodyDef -> Float
bodyDefAngularVelocity        :: Float
  , BodyDef -> Float
bodyDefLinearDamping          :: Float
  , BodyDef -> Float
bodyDefAngularDamping         :: Float
  , BodyDef -> Float
bodyDefGravityScale           :: Float
  , BodyDef -> Float
bodyDefSleepThreshold         :: Float
  , BodyDef -> CString
bodyDefName                   :: CString
  , BodyDef -> Ptr ()
bodyDefUserData               :: Ptr ()
  , BodyDef -> MotionLocks
bodyDefMotionLocks            :: MotionLocks
  , BodyDef -> CBool
bodyDefEnableSleep            :: CBool
  , BodyDef -> CBool
bodyDefIsAwake                :: CBool
  , BodyDef -> CBool
bodyDefIsBullet               :: CBool
  , BodyDef -> CBool
bodyDefIsEnabled              :: CBool
  , BodyDef -> CBool
bodyDefAllowFastRotation      :: CBool
  , BodyDef -> CBool
bodyDefEnableContactRecycling :: CBool
  , BodyDef -> CInt
bodyDefInternalValue          :: CInt
  }
  deriving (BodyDef -> BodyDef -> Bool
(BodyDef -> BodyDef -> Bool)
-> (BodyDef -> BodyDef -> Bool) -> Eq BodyDef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BodyDef -> BodyDef -> Bool
== :: BodyDef -> BodyDef -> Bool
$c/= :: BodyDef -> BodyDef -> Bool
/= :: BodyDef -> BodyDef -> Bool
Eq, Int -> BodyDef -> ShowS
[BodyDef] -> ShowS
BodyDef -> String
(Int -> BodyDef -> ShowS)
-> (BodyDef -> String) -> ([BodyDef] -> ShowS) -> Show BodyDef
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BodyDef -> ShowS
showsPrec :: Int -> BodyDef -> ShowS
$cshow :: BodyDef -> String
show :: BodyDef -> String
$cshowList :: [BodyDef] -> ShowS
showList :: [BodyDef] -> ShowS
Show)

instance Storable BodyDef where
  sizeOf :: BodyDef -> Int
sizeOf BodyDef
_ = (Int
80)
{-# LINE 489 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 490 "src/Box2D/Types.hsc" #-}
  peek p =
    BodyDef
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 493 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 4) p
{-# LINE 494 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 12) p
{-# LINE 495 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 20) p
{-# LINE 496 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 28) p
{-# LINE 497 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 32) p
{-# LINE 498 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 36) p
{-# LINE 499 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 40) p
{-# LINE 500 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 44) p
{-# LINE 501 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 48) p
{-# LINE 502 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 56) p
{-# LINE 503 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 64) p
{-# LINE 504 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 67) p
{-# LINE 505 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 68) p
{-# LINE 506 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 69) p
{-# LINE 507 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 70) p
{-# LINE 508 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 71) p
{-# LINE 509 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 72) p
{-# LINE 510 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 76) p
{-# LINE 511 "src/Box2D/Types.hsc" #-}
  poke p d = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (bodyDefType d)
{-# LINE 513 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 4) p (bodyDefPosition d)
{-# LINE 514 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 12) p (bodyDefRotation d)
{-# LINE 515 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 20) p (bodyDefLinearVelocity d)
{-# LINE 516 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 28) p (bodyDefAngularVelocity d)
{-# LINE 517 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 32) p (bodyDefLinearDamping d)
{-# LINE 518 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 36) p (bodyDefAngularDamping d)
{-# LINE 519 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 40) p (bodyDefGravityScale d)
{-# LINE 520 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 44) p (bodyDefSleepThreshold d)
{-# LINE 521 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 48) p (bodyDefName d)
{-# LINE 522 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 56) p (bodyDefUserData d)
{-# LINE 523 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 64) p (bodyDefMotionLocks d)
{-# LINE 524 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 67) p (bodyDefEnableSleep d)
{-# LINE 525 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 68) p (bodyDefIsAwake d)
{-# LINE 526 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 69) p (bodyDefIsBullet d)
{-# LINE 527 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 70) p (bodyDefIsEnabled d)
{-# LINE 528 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 71) p (bodyDefAllowFastRotation d)
{-# LINE 529 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 72) p (bodyDefEnableContactRecycling d)
{-# LINE 530 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 76) p (bodyDefInternalValue d)
{-# LINE 531 "src/Box2D/Types.hsc" #-}

-- | Shape creation definition. Initialise with 'defaultShapeDef'.
data ShapeDef = ShapeDef
  { ShapeDef -> Ptr ()
shapeDefUserData              :: Ptr ()
  , ShapeDef -> SurfaceMaterial
shapeDefMaterial              :: SurfaceMaterial
  , ShapeDef -> Float
shapeDefDensity               :: Float
  , ShapeDef -> Filter
shapeDefFilter                :: Filter
  , ShapeDef -> CBool
shapeDefEnableCustomFiltering :: CBool
  , ShapeDef -> CBool
shapeDefIsSensor              :: CBool
  -- ^ Create-time only: a shape cannot change sensor-ness after creation.
  , ShapeDef -> CBool
shapeDefEnableSensorEvents    :: CBool
  -- ^ Needed on the sensor /and/ the visiting shape for sensor events.
  , ShapeDef -> CBool
shapeDefEnableContactEvents   :: CBool
  -- ^ Contact events are opt-in per shape (both shapes of the pair).
  , ShapeDef -> CBool
shapeDefEnableHitEvents       :: CBool
  -- ^ Hit events additionally require exceeding @worldDefHitEventThreshold@.
  , ShapeDef -> CBool
shapeDefEnablePreSolveEvents  :: CBool
  , ShapeDef -> CBool
shapeDefInvokeContactCreation :: CBool
  , ShapeDef -> CBool
shapeDefUpdateBodyMass        :: CBool
  , ShapeDef -> CInt
shapeDefInternalValue         :: CInt
  }
  deriving (ShapeDef -> ShapeDef -> Bool
(ShapeDef -> ShapeDef -> Bool)
-> (ShapeDef -> ShapeDef -> Bool) -> Eq ShapeDef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ShapeDef -> ShapeDef -> Bool
== :: ShapeDef -> ShapeDef -> Bool
$c/= :: ShapeDef -> ShapeDef -> Bool
/= :: ShapeDef -> ShapeDef -> Bool
Eq, Int -> ShapeDef -> ShowS
[ShapeDef] -> ShowS
ShapeDef -> String
(Int -> ShapeDef -> ShowS)
-> (ShapeDef -> String) -> ([ShapeDef] -> ShowS) -> Show ShapeDef
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ShapeDef -> ShowS
showsPrec :: Int -> ShapeDef -> ShowS
$cshow :: ShapeDef -> String
show :: ShapeDef -> String
$cshowList :: [ShapeDef] -> ShowS
showList :: [ShapeDef] -> ShowS
Show)

instance Storable ShapeDef where
  sizeOf :: ShapeDef -> Int
sizeOf ShapeDef
_ = (Int
88)
{-# LINE 556 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 557 "src/Box2D/Types.hsc" #-}
  peek p =
    ShapeDef
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 560 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 561 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 40) p
{-# LINE 562 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 48) p
{-# LINE 563 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 72) p
{-# LINE 564 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 73) p
{-# LINE 565 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 74) p
{-# LINE 566 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 75) p
{-# LINE 567 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 76) p
{-# LINE 568 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 77) p
{-# LINE 569 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 78) p
{-# LINE 570 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 79) p
{-# LINE 571 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 80) p
{-# LINE 572 "src/Box2D/Types.hsc" #-}
  poke p d = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (shapeDefUserData d)
{-# LINE 574 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (shapeDefMaterial d)
{-# LINE 575 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 40) p (shapeDefDensity d)
{-# LINE 576 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 48) p (shapeDefFilter d)
{-# LINE 577 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 72) p (shapeDefEnableCustomFiltering d)
{-# LINE 578 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 73) p (shapeDefIsSensor d)
{-# LINE 579 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 74) p (shapeDefEnableSensorEvents d)
{-# LINE 580 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 75) p (shapeDefEnableContactEvents d)
{-# LINE 581 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 76) p (shapeDefEnableHitEvents d)
{-# LINE 582 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 77) p (shapeDefEnablePreSolveEvents d)
{-# LINE 583 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 78) p (shapeDefInvokeContactCreation d)
{-# LINE 584 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 79) p (shapeDefUpdateBodyMass d)
{-# LINE 585 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 80) p (shapeDefInternalValue d)
{-# LINE 586 "src/Box2D/Types.hsc" #-}

-- Default definitions -----------------------------------------------------

foreign import ccall unsafe "hs_b2DefaultWorldDef"
  c_b2DefaultWorldDef :: Ptr WorldDef -> IO ()

foreign import ccall unsafe "hs_b2DefaultBodyDef"
  c_b2DefaultBodyDef :: Ptr BodyDef -> IO ()

foreign import ccall unsafe "hs_b2DefaultShapeDef"
  c_b2DefaultShapeDef :: Ptr ShapeDef -> IO ()

foreign import ccall unsafe "hs_b2DefaultFilter"
  c_b2DefaultFilter :: Ptr Filter -> IO ()

foreign import ccall unsafe "hs_b2DefaultSurfaceMaterial"
  c_b2DefaultSurfaceMaterial :: Ptr SurfaceMaterial -> IO ()

-- | A fully-initialised world definition.
defaultWorldDef :: IO WorldDef
defaultWorldDef :: IO WorldDef
defaultWorldDef = (Ptr WorldDef -> IO ()) -> IO WorldDef
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr WorldDef -> IO ()
c_b2DefaultWorldDef

-- | A fully-initialised body definition.
defaultBodyDef :: IO BodyDef
defaultBodyDef :: IO BodyDef
defaultBodyDef = (Ptr BodyDef -> IO ()) -> IO BodyDef
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr BodyDef -> IO ()
c_b2DefaultBodyDef

-- | A fully-initialised shape definition.
defaultShapeDef :: IO ShapeDef
defaultShapeDef :: IO ShapeDef
defaultShapeDef = (Ptr ShapeDef -> IO ()) -> IO ShapeDef
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr ShapeDef -> IO ()
c_b2DefaultShapeDef

-- | A fully-initialised collision filter.
defaultFilter :: IO Filter
defaultFilter :: IO Filter
defaultFilter = (Ptr Filter -> IO ()) -> IO Filter
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr Filter -> IO ()
c_b2DefaultFilter

-- | A fully-initialised surface material.
defaultSurfaceMaterial :: IO SurfaceMaterial
defaultSurfaceMaterial :: IO SurfaceMaterial
defaultSurfaceMaterial = (Ptr SurfaceMaterial -> IO ()) -> IO SurfaceMaterial
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr SurfaceMaterial -> IO ()
c_b2DefaultSurfaceMaterial

foreign import ccall unsafe "hs_b2DefaultChainDef"
  c_b2DefaultChainDef :: Ptr ChainDef -> IO ()

foreign import ccall unsafe "hs_b2DefaultExplosionDef"
  c_b2DefaultExplosionDef :: Ptr ExplosionDef -> IO ()

-- | Chain (static terrain) definition. Initialise with 'defaultChainDef',
-- then point 'chainDefPoints' at a pinned/'Foreign.Marshal.Array.withArray'
-- array that stays alive across @Box2D.Chain.create@.
data ChainDef = ChainDef
  { ChainDef -> Ptr ()
chainDefUserData           :: Ptr ()
  , ChainDef -> Ptr Vec2
chainDefPoints             :: Ptr Vec2
  , ChainDef -> CInt
chainDefCount              :: CInt
  , ChainDef -> Ptr SurfaceMaterial
chainDefMaterials          :: Ptr SurfaceMaterial
  , ChainDef -> CInt
chainDefMaterialCount      :: CInt
  , ChainDef -> Filter
chainDefFilter             :: Filter
  , ChainDef -> CBool
chainDefIsLoop             :: CBool
  , ChainDef -> CBool
chainDefEnableSensorEvents :: CBool
  , ChainDef -> CInt
chainDefInternalValue      :: CInt
  }
  deriving (ChainDef -> ChainDef -> Bool
(ChainDef -> ChainDef -> Bool)
-> (ChainDef -> ChainDef -> Bool) -> Eq ChainDef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ChainDef -> ChainDef -> Bool
== :: ChainDef -> ChainDef -> Bool
$c/= :: ChainDef -> ChainDef -> Bool
/= :: ChainDef -> ChainDef -> Bool
Eq, Int -> ChainDef -> ShowS
[ChainDef] -> ShowS
ChainDef -> String
(Int -> ChainDef -> ShowS)
-> (ChainDef -> String) -> ([ChainDef] -> ShowS) -> Show ChainDef
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChainDef -> ShowS
showsPrec :: Int -> ChainDef -> ShowS
$cshow :: ChainDef -> String
show :: ChainDef -> String
$cshowList :: [ChainDef] -> ShowS
showList :: [ChainDef] -> ShowS
Show)

instance Storable ChainDef where
  sizeOf :: ChainDef -> Int
sizeOf ChainDef
_ = (Int
72)
{-# LINE 648 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 649 "src/Box2D/Types.hsc" #-}
  peek p =
    ChainDef
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 652 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 653 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 654 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 24) p
{-# LINE 655 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 32) p
{-# LINE 656 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 40) p
{-# LINE 657 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 64) p
{-# LINE 658 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 65) p
{-# LINE 659 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 68) p
{-# LINE 660 "src/Box2D/Types.hsc" #-}
  poke p d = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (chainDefUserData d)
{-# LINE 662 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (chainDefPoints d)
{-# LINE 663 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p (chainDefCount d)
{-# LINE 664 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 24) p (chainDefMaterials d)
{-# LINE 665 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 32) p (chainDefMaterialCount d)
{-# LINE 666 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 40) p (chainDefFilter d)
{-# LINE 667 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 64) p (chainDefIsLoop d)
{-# LINE 668 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 65) p (chainDefEnableSensorEvents d)
{-# LINE 669 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 68) p (chainDefInternalValue d)
{-# LINE 670 "src/Box2D/Types.hsc" #-}

-- | A fully-initialised chain definition (carries the internal cookie).
defaultChainDef :: IO ChainDef
defaultChainDef :: IO ChainDef
defaultChainDef = (Ptr ChainDef -> IO ()) -> IO ChainDef
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr ChainDef -> IO ()
c_b2DefaultChainDef

-- | Explosion parameters for 'Box2D.World.explode'. Initialise with
-- 'defaultExplosionDef'.
data ExplosionDef = ExplosionDef
  { ExplosionDef -> Word64
explosionDefMaskBits         :: Word64
  , ExplosionDef -> Vec2
explosionDefPosition         :: Pos
  , ExplosionDef -> Float
explosionDefRadius           :: Float
  , ExplosionDef -> Float
explosionDefFalloff          :: Float
  , ExplosionDef -> Float
explosionDefImpulsePerLength :: Float
  }
  deriving (ExplosionDef -> ExplosionDef -> Bool
(ExplosionDef -> ExplosionDef -> Bool)
-> (ExplosionDef -> ExplosionDef -> Bool) -> Eq ExplosionDef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ExplosionDef -> ExplosionDef -> Bool
== :: ExplosionDef -> ExplosionDef -> Bool
$c/= :: ExplosionDef -> ExplosionDef -> Bool
/= :: ExplosionDef -> ExplosionDef -> Bool
Eq, Int -> ExplosionDef -> ShowS
[ExplosionDef] -> ShowS
ExplosionDef -> String
(Int -> ExplosionDef -> ShowS)
-> (ExplosionDef -> String)
-> ([ExplosionDef] -> ShowS)
-> Show ExplosionDef
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ExplosionDef -> ShowS
showsPrec :: Int -> ExplosionDef -> ShowS
$cshow :: ExplosionDef -> String
show :: ExplosionDef -> String
$cshowList :: [ExplosionDef] -> ShowS
showList :: [ExplosionDef] -> ShowS
Show)

instance Storable ExplosionDef where
  sizeOf :: ExplosionDef -> Int
sizeOf ExplosionDef
_ = (Int
32)
{-# LINE 688 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 689 "src/Box2D/Types.hsc" #-}
  peek p =
    ExplosionDef
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 692 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 693 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 694 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 20) p
{-# LINE 695 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 24) p
{-# LINE 696 "src/Box2D/Types.hsc" #-}
  poke p d = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (explosionDefMaskBits d)
{-# LINE 698 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (explosionDefPosition d)
{-# LINE 699 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p (explosionDefRadius d)
{-# LINE 700 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 20) p (explosionDefFalloff d)
{-# LINE 701 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 24) p (explosionDefImpulsePerLength d)
{-# LINE 702 "src/Box2D/Types.hsc" #-}

-- | A fully-initialised explosion definition.
defaultExplosionDef :: IO ExplosionDef
defaultExplosionDef :: IO ExplosionDef
defaultExplosionDef = (Ptr ExplosionDef -> IO ()) -> IO ExplosionDef
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr ExplosionDef -> IO ()
c_b2DefaultExplosionDef

-- Joint definitions ------------------------------------------------------

-- | The shared base of every joint definition.
data JointDef = JointDef
  { JointDef -> Ptr ()
jointDefUserData :: Ptr ()
  , JointDef -> BodyId
jointDefBodyIdA :: BodyId
  , JointDef -> BodyId
jointDefBodyIdB :: BodyId
  , JointDef -> Transform
jointDefLocalFrameA :: Transform
  , JointDef -> Transform
jointDefLocalFrameB :: Transform
  , JointDef -> Float
jointDefForceThreshold :: Float
  , JointDef -> Float
jointDefTorqueThreshold :: Float
  , JointDef -> Float
jointDefConstraintHertz :: Float
  , JointDef -> Float
jointDefConstraintDampingRatio :: Float
  , JointDef -> Float
jointDefDrawScale :: Float
  , JointDef -> CBool
jointDefCollideConnected :: CBool
  }
  deriving (JointDef -> JointDef -> Bool
(JointDef -> JointDef -> Bool)
-> (JointDef -> JointDef -> Bool) -> Eq JointDef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JointDef -> JointDef -> Bool
== :: JointDef -> JointDef -> Bool
$c/= :: JointDef -> JointDef -> Bool
/= :: JointDef -> JointDef -> Bool
Eq, Int -> JointDef -> ShowS
[JointDef] -> ShowS
JointDef -> String
(Int -> JointDef -> ShowS)
-> (JointDef -> String) -> ([JointDef] -> ShowS) -> Show JointDef
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> JointDef -> ShowS
showsPrec :: Int -> JointDef -> ShowS
$cshow :: JointDef -> String
show :: JointDef -> String
$cshowList :: [JointDef] -> ShowS
showList :: [JointDef] -> ShowS
Show)

instance Storable JointDef where
  sizeOf :: JointDef -> Int
sizeOf JointDef
_ = (Int
80)
{-# LINE 727 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 728 "src/Box2D/Types.hsc" #-}
  peek p =
    JointDef
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 731 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 732 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 733 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 24) p
{-# LINE 734 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 40) p
{-# LINE 735 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 56) p
{-# LINE 736 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 60) p
{-# LINE 737 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 64) p
{-# LINE 738 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 68) p
{-# LINE 739 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 72) p
{-# LINE 740 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 76) p
{-# LINE 741 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (jointDefUserData x)
{-# LINE 743 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (jointDefBodyIdA x)
{-# LINE 744 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p (jointDefBodyIdB x)
{-# LINE 745 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 24) p (jointDefLocalFrameA x)
{-# LINE 746 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 40) p (jointDefLocalFrameB x)
{-# LINE 747 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 56) p (jointDefForceThreshold x)
{-# LINE 748 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 60) p (jointDefTorqueThreshold x)
{-# LINE 749 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 64) p (jointDefConstraintHertz x)
{-# LINE 750 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 68) p (jointDefConstraintDampingRatio x)
{-# LINE 751 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 72) p (jointDefDrawScale x)
{-# LINE 752 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 76) p (jointDefCollideConnected x)
{-# LINE 753 "src/Box2D/Types.hsc" #-}

-- | Distance joint definition. Initialise with 'defaultDistanceJointDef'.
data DistanceJointDef = DistanceJointDef
  { DistanceJointDef -> JointDef
distanceJointDefBase :: JointDef
  , DistanceJointDef -> Float
distanceJointDefLength :: Float
  , DistanceJointDef -> CBool
distanceJointDefEnableSpring :: CBool
  , DistanceJointDef -> Float
distanceJointDefLowerSpringForce :: Float
  , DistanceJointDef -> Float
distanceJointDefUpperSpringForce :: Float
  , DistanceJointDef -> Float
distanceJointDefHertz :: Float
  , DistanceJointDef -> Float
distanceJointDefDampingRatio :: Float
  , DistanceJointDef -> CBool
distanceJointDefEnableLimit :: CBool
  , DistanceJointDef -> Float
distanceJointDefMinLength :: Float
  , DistanceJointDef -> Float
distanceJointDefMaxLength :: Float
  , DistanceJointDef -> CBool
distanceJointDefEnableMotor :: CBool
  , DistanceJointDef -> Float
distanceJointDefMaxMotorForce :: Float
  , DistanceJointDef -> Float
distanceJointDefMotorSpeed :: Float
  , DistanceJointDef -> CInt
distanceJointDefInternalValue :: CInt
  }
  deriving (DistanceJointDef -> DistanceJointDef -> Bool
(DistanceJointDef -> DistanceJointDef -> Bool)
-> (DistanceJointDef -> DistanceJointDef -> Bool)
-> Eq DistanceJointDef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DistanceJointDef -> DistanceJointDef -> Bool
== :: DistanceJointDef -> DistanceJointDef -> Bool
$c/= :: DistanceJointDef -> DistanceJointDef -> Bool
/= :: DistanceJointDef -> DistanceJointDef -> Bool
Eq, Int -> DistanceJointDef -> ShowS
[DistanceJointDef] -> ShowS
DistanceJointDef -> String
(Int -> DistanceJointDef -> ShowS)
-> (DistanceJointDef -> String)
-> ([DistanceJointDef] -> ShowS)
-> Show DistanceJointDef
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DistanceJointDef -> ShowS
showsPrec :: Int -> DistanceJointDef -> ShowS
$cshow :: DistanceJointDef -> String
show :: DistanceJointDef -> String
$cshowList :: [DistanceJointDef] -> ShowS
showList :: [DistanceJointDef] -> ShowS
Show)

instance Storable DistanceJointDef where
  sizeOf :: DistanceJointDef -> Int
sizeOf DistanceJointDef
_ = (Int
136)
{-# LINE 775 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 776 "src/Box2D/Types.hsc" #-}
  peek p =
    DistanceJointDef
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 779 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 80) p
{-# LINE 780 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 84) p
{-# LINE 781 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 88) p
{-# LINE 782 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 92) p
{-# LINE 783 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 96) p
{-# LINE 784 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 100) p
{-# LINE 785 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 104) p
{-# LINE 786 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 108) p
{-# LINE 787 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 112) p
{-# LINE 788 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 116) p
{-# LINE 789 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 120) p
{-# LINE 790 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 124) p
{-# LINE 791 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 128) p
{-# LINE 792 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (distanceJointDefBase x)
{-# LINE 794 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 80) p (distanceJointDefLength x)
{-# LINE 795 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 84) p (distanceJointDefEnableSpring x)
{-# LINE 796 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 88) p (distanceJointDefLowerSpringForce x)
{-# LINE 797 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 92) p (distanceJointDefUpperSpringForce x)
{-# LINE 798 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 96) p (distanceJointDefHertz x)
{-# LINE 799 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 100) p (distanceJointDefDampingRatio x)
{-# LINE 800 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 104) p (distanceJointDefEnableLimit x)
{-# LINE 801 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 108) p (distanceJointDefMinLength x)
{-# LINE 802 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 112) p (distanceJointDefMaxLength x)
{-# LINE 803 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 116) p (distanceJointDefEnableMotor x)
{-# LINE 804 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 120) p (distanceJointDefMaxMotorForce x)
{-# LINE 805 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 124) p (distanceJointDefMotorSpeed x)
{-# LINE 806 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 128) p (distanceJointDefInternalValue x)
{-# LINE 807 "src/Box2D/Types.hsc" #-}

-- | Motor joint definition. Initialise with 'defaultMotorJointDef'.
data MotorJointDef = MotorJointDef
  { MotorJointDef -> JointDef
motorJointDefBase :: JointDef
  , MotorJointDef -> Vec2
motorJointDefLinearVelocity :: Vec2
  , MotorJointDef -> Float
motorJointDefMaxVelocityForce :: Float
  , MotorJointDef -> Float
motorJointDefAngularVelocity :: Float
  , MotorJointDef -> Float
motorJointDefMaxVelocityTorque :: Float
  , MotorJointDef -> Float
motorJointDefLinearHertz :: Float
  , MotorJointDef -> Float
motorJointDefLinearDampingRatio :: Float
  , MotorJointDef -> Float
motorJointDefMaxSpringForce :: Float
  , MotorJointDef -> Float
motorJointDefAngularHertz :: Float
  , MotorJointDef -> Float
motorJointDefAngularDampingRatio :: Float
  , MotorJointDef -> Float
motorJointDefMaxSpringTorque :: Float
  , MotorJointDef -> CInt
motorJointDefInternalValue :: CInt
  }
  deriving (MotorJointDef -> MotorJointDef -> Bool
(MotorJointDef -> MotorJointDef -> Bool)
-> (MotorJointDef -> MotorJointDef -> Bool) -> Eq MotorJointDef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MotorJointDef -> MotorJointDef -> Bool
== :: MotorJointDef -> MotorJointDef -> Bool
$c/= :: MotorJointDef -> MotorJointDef -> Bool
/= :: MotorJointDef -> MotorJointDef -> Bool
Eq, Int -> MotorJointDef -> ShowS
[MotorJointDef] -> ShowS
MotorJointDef -> String
(Int -> MotorJointDef -> ShowS)
-> (MotorJointDef -> String)
-> ([MotorJointDef] -> ShowS)
-> Show MotorJointDef
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MotorJointDef -> ShowS
showsPrec :: Int -> MotorJointDef -> ShowS
$cshow :: MotorJointDef -> String
show :: MotorJointDef -> String
$cshowList :: [MotorJointDef] -> ShowS
showList :: [MotorJointDef] -> ShowS
Show)

instance Storable MotorJointDef where
  sizeOf :: MotorJointDef -> Int
sizeOf MotorJointDef
_ = (Int
128)
{-# LINE 827 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 828 "src/Box2D/Types.hsc" #-}
  peek p =
    MotorJointDef
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 831 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 80) p
{-# LINE 832 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 88) p
{-# LINE 833 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 92) p
{-# LINE 834 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 96) p
{-# LINE 835 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 100) p
{-# LINE 836 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 104) p
{-# LINE 837 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 108) p
{-# LINE 838 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 112) p
{-# LINE 839 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 116) p
{-# LINE 840 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 120) p
{-# LINE 841 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 124) p
{-# LINE 842 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (motorJointDefBase x)
{-# LINE 844 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 80) p (motorJointDefLinearVelocity x)
{-# LINE 845 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 88) p (motorJointDefMaxVelocityForce x)
{-# LINE 846 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 92) p (motorJointDefAngularVelocity x)
{-# LINE 847 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 96) p (motorJointDefMaxVelocityTorque x)
{-# LINE 848 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 100) p (motorJointDefLinearHertz x)
{-# LINE 849 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 104) p (motorJointDefLinearDampingRatio x)
{-# LINE 850 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 108) p (motorJointDefMaxSpringForce x)
{-# LINE 851 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 112) p (motorJointDefAngularHertz x)
{-# LINE 852 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 116) p (motorJointDefAngularDampingRatio x)
{-# LINE 853 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 120) p (motorJointDefMaxSpringTorque x)
{-# LINE 854 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 124) p (motorJointDefInternalValue x)
{-# LINE 855 "src/Box2D/Types.hsc" #-}

-- | Prismatic joint definition. Initialise with 'defaultPrismaticJointDef'.
data PrismaticJointDef = PrismaticJointDef
  { PrismaticJointDef -> JointDef
prismaticJointDefBase :: JointDef
  , PrismaticJointDef -> CBool
prismaticJointDefEnableSpring :: CBool
  , PrismaticJointDef -> Float
prismaticJointDefHertz :: Float
  , PrismaticJointDef -> Float
prismaticJointDefDampingRatio :: Float
  , PrismaticJointDef -> Float
prismaticJointDefTargetTranslation :: Float
  , PrismaticJointDef -> CBool
prismaticJointDefEnableLimit :: CBool
  , PrismaticJointDef -> Float
prismaticJointDefLowerTranslation :: Float
  , PrismaticJointDef -> Float
prismaticJointDefUpperTranslation :: Float
  , PrismaticJointDef -> CBool
prismaticJointDefEnableMotor :: CBool
  , PrismaticJointDef -> Float
prismaticJointDefMaxMotorForce :: Float
  , PrismaticJointDef -> Float
prismaticJointDefMotorSpeed :: Float
  , PrismaticJointDef -> CInt
prismaticJointDefInternalValue :: CInt
  }
  deriving (PrismaticJointDef -> PrismaticJointDef -> Bool
(PrismaticJointDef -> PrismaticJointDef -> Bool)
-> (PrismaticJointDef -> PrismaticJointDef -> Bool)
-> Eq PrismaticJointDef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PrismaticJointDef -> PrismaticJointDef -> Bool
== :: PrismaticJointDef -> PrismaticJointDef -> Bool
$c/= :: PrismaticJointDef -> PrismaticJointDef -> Bool
/= :: PrismaticJointDef -> PrismaticJointDef -> Bool
Eq, Int -> PrismaticJointDef -> ShowS
[PrismaticJointDef] -> ShowS
PrismaticJointDef -> String
(Int -> PrismaticJointDef -> ShowS)
-> (PrismaticJointDef -> String)
-> ([PrismaticJointDef] -> ShowS)
-> Show PrismaticJointDef
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PrismaticJointDef -> ShowS
showsPrec :: Int -> PrismaticJointDef -> ShowS
$cshow :: PrismaticJointDef -> String
show :: PrismaticJointDef -> String
$cshowList :: [PrismaticJointDef] -> ShowS
showList :: [PrismaticJointDef] -> ShowS
Show)

instance Storable PrismaticJointDef where
  sizeOf :: PrismaticJointDef -> Int
sizeOf PrismaticJointDef
_ = (Int
128)
{-# LINE 875 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 876 "src/Box2D/Types.hsc" #-}
  peek p =
    PrismaticJointDef
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 879 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 80) p
{-# LINE 880 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 84) p
{-# LINE 881 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 88) p
{-# LINE 882 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 92) p
{-# LINE 883 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 96) p
{-# LINE 884 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 100) p
{-# LINE 885 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 104) p
{-# LINE 886 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 108) p
{-# LINE 887 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 112) p
{-# LINE 888 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 116) p
{-# LINE 889 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 120) p
{-# LINE 890 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (prismaticJointDefBase x)
{-# LINE 892 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 80) p (prismaticJointDefEnableSpring x)
{-# LINE 893 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 84) p (prismaticJointDefHertz x)
{-# LINE 894 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 88) p (prismaticJointDefDampingRatio x)
{-# LINE 895 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 92) p (prismaticJointDefTargetTranslation x)
{-# LINE 896 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 96) p (prismaticJointDefEnableLimit x)
{-# LINE 897 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 100) p (prismaticJointDefLowerTranslation x)
{-# LINE 898 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 104) p (prismaticJointDefUpperTranslation x)
{-# LINE 899 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 108) p (prismaticJointDefEnableMotor x)
{-# LINE 900 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 112) p (prismaticJointDefMaxMotorForce x)
{-# LINE 901 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 116) p (prismaticJointDefMotorSpeed x)
{-# LINE 902 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 120) p (prismaticJointDefInternalValue x)
{-# LINE 903 "src/Box2D/Types.hsc" #-}

-- | Revolute joint definition. Initialise with 'defaultRevoluteJointDef'.
data RevoluteJointDef = RevoluteJointDef
  { RevoluteJointDef -> JointDef
revoluteJointDefBase :: JointDef
  , RevoluteJointDef -> Float
revoluteJointDefTargetAngle :: Float
  , RevoluteJointDef -> CBool
revoluteJointDefEnableSpring :: CBool
  , RevoluteJointDef -> Float
revoluteJointDefHertz :: Float
  , RevoluteJointDef -> Float
revoluteJointDefDampingRatio :: Float
  , RevoluteJointDef -> CBool
revoluteJointDefEnableLimit :: CBool
  , RevoluteJointDef -> Float
revoluteJointDefLowerAngle :: Float
  , RevoluteJointDef -> Float
revoluteJointDefUpperAngle :: Float
  , RevoluteJointDef -> CBool
revoluteJointDefEnableMotor :: CBool
  , RevoluteJointDef -> Float
revoluteJointDefMaxMotorTorque :: Float
  , RevoluteJointDef -> Float
revoluteJointDefMotorSpeed :: Float
  , RevoluteJointDef -> CInt
revoluteJointDefInternalValue :: CInt
  }
  deriving (RevoluteJointDef -> RevoluteJointDef -> Bool
(RevoluteJointDef -> RevoluteJointDef -> Bool)
-> (RevoluteJointDef -> RevoluteJointDef -> Bool)
-> Eq RevoluteJointDef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RevoluteJointDef -> RevoluteJointDef -> Bool
== :: RevoluteJointDef -> RevoluteJointDef -> Bool
$c/= :: RevoluteJointDef -> RevoluteJointDef -> Bool
/= :: RevoluteJointDef -> RevoluteJointDef -> Bool
Eq, Int -> RevoluteJointDef -> ShowS
[RevoluteJointDef] -> ShowS
RevoluteJointDef -> String
(Int -> RevoluteJointDef -> ShowS)
-> (RevoluteJointDef -> String)
-> ([RevoluteJointDef] -> ShowS)
-> Show RevoluteJointDef
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RevoluteJointDef -> ShowS
showsPrec :: Int -> RevoluteJointDef -> ShowS
$cshow :: RevoluteJointDef -> String
show :: RevoluteJointDef -> String
$cshowList :: [RevoluteJointDef] -> ShowS
showList :: [RevoluteJointDef] -> ShowS
Show)

instance Storable RevoluteJointDef where
  sizeOf :: RevoluteJointDef -> Int
sizeOf RevoluteJointDef
_ = (Int
128)
{-# LINE 923 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 924 "src/Box2D/Types.hsc" #-}
  peek p =
    RevoluteJointDef
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 927 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 80) p
{-# LINE 928 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 84) p
{-# LINE 929 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 88) p
{-# LINE 930 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 92) p
{-# LINE 931 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 96) p
{-# LINE 932 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 100) p
{-# LINE 933 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 104) p
{-# LINE 934 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 108) p
{-# LINE 935 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 112) p
{-# LINE 936 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 116) p
{-# LINE 937 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 120) p
{-# LINE 938 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (revoluteJointDefBase x)
{-# LINE 940 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 80) p (revoluteJointDefTargetAngle x)
{-# LINE 941 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 84) p (revoluteJointDefEnableSpring x)
{-# LINE 942 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 88) p (revoluteJointDefHertz x)
{-# LINE 943 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 92) p (revoluteJointDefDampingRatio x)
{-# LINE 944 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 96) p (revoluteJointDefEnableLimit x)
{-# LINE 945 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 100) p (revoluteJointDefLowerAngle x)
{-# LINE 946 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 104) p (revoluteJointDefUpperAngle x)
{-# LINE 947 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 108) p (revoluteJointDefEnableMotor x)
{-# LINE 948 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 112) p (revoluteJointDefMaxMotorTorque x)
{-# LINE 949 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 116) p (revoluteJointDefMotorSpeed x)
{-# LINE 950 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 120) p (revoluteJointDefInternalValue x)
{-# LINE 951 "src/Box2D/Types.hsc" #-}

-- | Weld joint definition. Initialise with 'defaultWeldJointDef'.
data WeldJointDef = WeldJointDef
  { WeldJointDef -> JointDef
weldJointDefBase :: JointDef
  , WeldJointDef -> Float
weldJointDefLinearHertz :: Float
  , WeldJointDef -> Float
weldJointDefAngularHertz :: Float
  , WeldJointDef -> Float
weldJointDefLinearDampingRatio :: Float
  , WeldJointDef -> Float
weldJointDefAngularDampingRatio :: Float
  , WeldJointDef -> CInt
weldJointDefInternalValue :: CInt
  }
  deriving (WeldJointDef -> WeldJointDef -> Bool
(WeldJointDef -> WeldJointDef -> Bool)
-> (WeldJointDef -> WeldJointDef -> Bool) -> Eq WeldJointDef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WeldJointDef -> WeldJointDef -> Bool
== :: WeldJointDef -> WeldJointDef -> Bool
$c/= :: WeldJointDef -> WeldJointDef -> Bool
/= :: WeldJointDef -> WeldJointDef -> Bool
Eq, Int -> WeldJointDef -> ShowS
[WeldJointDef] -> ShowS
WeldJointDef -> String
(Int -> WeldJointDef -> ShowS)
-> (WeldJointDef -> String)
-> ([WeldJointDef] -> ShowS)
-> Show WeldJointDef
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WeldJointDef -> ShowS
showsPrec :: Int -> WeldJointDef -> ShowS
$cshow :: WeldJointDef -> String
show :: WeldJointDef -> String
$cshowList :: [WeldJointDef] -> ShowS
showList :: [WeldJointDef] -> ShowS
Show)

instance Storable WeldJointDef where
  sizeOf :: WeldJointDef -> Int
sizeOf WeldJointDef
_ = (Int
104)
{-# LINE 965 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 966 "src/Box2D/Types.hsc" #-}
  peek p =
    WeldJointDef
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 969 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 80) p
{-# LINE 970 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 84) p
{-# LINE 971 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 88) p
{-# LINE 972 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 92) p
{-# LINE 973 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 96) p
{-# LINE 974 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (weldJointDefBase x)
{-# LINE 976 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 80) p (weldJointDefLinearHertz x)
{-# LINE 977 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 84) p (weldJointDefAngularHertz x)
{-# LINE 978 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 88) p (weldJointDefLinearDampingRatio x)
{-# LINE 979 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 92) p (weldJointDefAngularDampingRatio x)
{-# LINE 980 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 96) p (weldJointDefInternalValue x)
{-# LINE 981 "src/Box2D/Types.hsc" #-}

-- | Wheel joint definition. Initialise with 'defaultWheelJointDef'.
data WheelJointDef = WheelJointDef
  { WheelJointDef -> JointDef
wheelJointDefBase :: JointDef
  , WheelJointDef -> CBool
wheelJointDefEnableSpring :: CBool
  , WheelJointDef -> Float
wheelJointDefHertz :: Float
  , WheelJointDef -> Float
wheelJointDefDampingRatio :: Float
  , WheelJointDef -> CBool
wheelJointDefEnableLimit :: CBool
  , WheelJointDef -> Float
wheelJointDefLowerTranslation :: Float
  , WheelJointDef -> Float
wheelJointDefUpperTranslation :: Float
  , WheelJointDef -> CBool
wheelJointDefEnableMotor :: CBool
  , WheelJointDef -> Float
wheelJointDefMaxMotorTorque :: Float
  , WheelJointDef -> Float
wheelJointDefMotorSpeed :: Float
  , WheelJointDef -> CInt
wheelJointDefInternalValue :: CInt
  }
  deriving (WheelJointDef -> WheelJointDef -> Bool
(WheelJointDef -> WheelJointDef -> Bool)
-> (WheelJointDef -> WheelJointDef -> Bool) -> Eq WheelJointDef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WheelJointDef -> WheelJointDef -> Bool
== :: WheelJointDef -> WheelJointDef -> Bool
$c/= :: WheelJointDef -> WheelJointDef -> Bool
/= :: WheelJointDef -> WheelJointDef -> Bool
Eq, Int -> WheelJointDef -> ShowS
[WheelJointDef] -> ShowS
WheelJointDef -> String
(Int -> WheelJointDef -> ShowS)
-> (WheelJointDef -> String)
-> ([WheelJointDef] -> ShowS)
-> Show WheelJointDef
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WheelJointDef -> ShowS
showsPrec :: Int -> WheelJointDef -> ShowS
$cshow :: WheelJointDef -> String
show :: WheelJointDef -> String
$cshowList :: [WheelJointDef] -> ShowS
showList :: [WheelJointDef] -> ShowS
Show)

instance Storable WheelJointDef where
  sizeOf :: WheelJointDef -> Int
sizeOf WheelJointDef
_ = (Int
120)
{-# LINE 1000 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 1001 "src/Box2D/Types.hsc" #-}
  peek p =
    WheelJointDef
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1004 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 80) p
{-# LINE 1005 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 84) p
{-# LINE 1006 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 88) p
{-# LINE 1007 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 92) p
{-# LINE 1008 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 96) p
{-# LINE 1009 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 100) p
{-# LINE 1010 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 104) p
{-# LINE 1011 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 108) p
{-# LINE 1012 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 112) p
{-# LINE 1013 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 116) p
{-# LINE 1014 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (wheelJointDefBase x)
{-# LINE 1016 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 80) p (wheelJointDefEnableSpring x)
{-# LINE 1017 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 84) p (wheelJointDefHertz x)
{-# LINE 1018 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 88) p (wheelJointDefDampingRatio x)
{-# LINE 1019 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 92) p (wheelJointDefEnableLimit x)
{-# LINE 1020 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 96) p (wheelJointDefLowerTranslation x)
{-# LINE 1021 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 100) p (wheelJointDefUpperTranslation x)
{-# LINE 1022 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 104) p (wheelJointDefEnableMotor x)
{-# LINE 1023 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 108) p (wheelJointDefMaxMotorTorque x)
{-# LINE 1024 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 112) p (wheelJointDefMotorSpeed x)
{-# LINE 1025 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 116) p (wheelJointDefInternalValue x)
{-# LINE 1026 "src/Box2D/Types.hsc" #-}

-- | Filter joint definition. Initialise with 'defaultFilterJointDef'.
data FilterJointDef = FilterJointDef
  { FilterJointDef -> JointDef
filterJointDefBase :: JointDef
  , FilterJointDef -> CInt
filterJointDefInternalValue :: CInt
  }
  deriving (FilterJointDef -> FilterJointDef -> Bool
(FilterJointDef -> FilterJointDef -> Bool)
-> (FilterJointDef -> FilterJointDef -> Bool) -> Eq FilterJointDef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FilterJointDef -> FilterJointDef -> Bool
== :: FilterJointDef -> FilterJointDef -> Bool
$c/= :: FilterJointDef -> FilterJointDef -> Bool
/= :: FilterJointDef -> FilterJointDef -> Bool
Eq, Int -> FilterJointDef -> ShowS
[FilterJointDef] -> ShowS
FilterJointDef -> String
(Int -> FilterJointDef -> ShowS)
-> (FilterJointDef -> String)
-> ([FilterJointDef] -> ShowS)
-> Show FilterJointDef
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FilterJointDef -> ShowS
showsPrec :: Int -> FilterJointDef -> ShowS
$cshow :: FilterJointDef -> String
show :: FilterJointDef -> String
$cshowList :: [FilterJointDef] -> ShowS
showList :: [FilterJointDef] -> ShowS
Show)

instance Storable FilterJointDef where
  sizeOf :: FilterJointDef -> Int
sizeOf FilterJointDef
_ = (Int
88)
{-# LINE 1036 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 1037 "src/Box2D/Types.hsc" #-}
  peek p =
    FilterJointDef
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1040 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 80) p
{-# LINE 1041 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (filterJointDefBase x)
{-# LINE 1043 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 80) p (filterJointDefInternalValue x)
{-# LINE 1044 "src/Box2D/Types.hsc" #-}

-- Joint definition defaults ----------------------------------------------

foreign import ccall unsafe "hs_b2DefaultDistanceJointDef"
  c_b2DefaultDistanceJointDef :: Ptr DistanceJointDef -> IO ()

foreign import ccall unsafe "hs_b2DefaultMotorJointDef"
  c_b2DefaultMotorJointDef :: Ptr MotorJointDef -> IO ()

foreign import ccall unsafe "hs_b2DefaultPrismaticJointDef"
  c_b2DefaultPrismaticJointDef :: Ptr PrismaticJointDef -> IO ()

foreign import ccall unsafe "hs_b2DefaultRevoluteJointDef"
  c_b2DefaultRevoluteJointDef :: Ptr RevoluteJointDef -> IO ()

foreign import ccall unsafe "hs_b2DefaultWeldJointDef"
  c_b2DefaultWeldJointDef :: Ptr WeldJointDef -> IO ()

foreign import ccall unsafe "hs_b2DefaultWheelJointDef"
  c_b2DefaultWheelJointDef :: Ptr WheelJointDef -> IO ()

foreign import ccall unsafe "hs_b2DefaultFilterJointDef"
  c_b2DefaultFilterJointDef :: Ptr FilterJointDef -> IO ()

-- | A fully-initialised DistanceJointDef.
defaultDistanceJointDef :: IO DistanceJointDef
defaultDistanceJointDef :: IO DistanceJointDef
defaultDistanceJointDef = (Ptr DistanceJointDef -> IO ()) -> IO DistanceJointDef
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr DistanceJointDef -> IO ()
c_b2DefaultDistanceJointDef

-- | A fully-initialised MotorJointDef.
defaultMotorJointDef :: IO MotorJointDef
defaultMotorJointDef :: IO MotorJointDef
defaultMotorJointDef = (Ptr MotorJointDef -> IO ()) -> IO MotorJointDef
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr MotorJointDef -> IO ()
c_b2DefaultMotorJointDef

-- | A fully-initialised PrismaticJointDef.
defaultPrismaticJointDef :: IO PrismaticJointDef
defaultPrismaticJointDef :: IO PrismaticJointDef
defaultPrismaticJointDef = (Ptr PrismaticJointDef -> IO ()) -> IO PrismaticJointDef
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr PrismaticJointDef -> IO ()
c_b2DefaultPrismaticJointDef

-- | A fully-initialised RevoluteJointDef.
defaultRevoluteJointDef :: IO RevoluteJointDef
defaultRevoluteJointDef :: IO RevoluteJointDef
defaultRevoluteJointDef = (Ptr RevoluteJointDef -> IO ()) -> IO RevoluteJointDef
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr RevoluteJointDef -> IO ()
c_b2DefaultRevoluteJointDef

-- | A fully-initialised WeldJointDef.
defaultWeldJointDef :: IO WeldJointDef
defaultWeldJointDef :: IO WeldJointDef
defaultWeldJointDef = (Ptr WeldJointDef -> IO ()) -> IO WeldJointDef
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr WeldJointDef -> IO ()
c_b2DefaultWeldJointDef

-- | A fully-initialised WheelJointDef.
defaultWheelJointDef :: IO WheelJointDef
defaultWheelJointDef :: IO WheelJointDef
defaultWheelJointDef = (Ptr WheelJointDef -> IO ()) -> IO WheelJointDef
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr WheelJointDef -> IO ()
c_b2DefaultWheelJointDef

-- | A fully-initialised FilterJointDef.
defaultFilterJointDef :: IO FilterJointDef
defaultFilterJointDef :: IO FilterJointDef
defaultFilterJointDef = (Ptr FilterJointDef -> IO ()) -> IO FilterJointDef
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr FilterJointDef -> IO ()
c_b2DefaultFilterJointDef

-- Queries and casts --------------------------------------------------------

foreign import ccall unsafe "hs_b2DefaultQueryFilter"
  c_b2DefaultQueryFilter :: Ptr QueryFilter -> IO ()

-- | Filter for world queries: which shape categories to accept.
data QueryFilter = QueryFilter
  { QueryFilter -> Word64
queryFilterCategoryBits :: Word64
  , QueryFilter -> Word64
queryFilterMaskBits     :: Word64
  }
  deriving (QueryFilter -> QueryFilter -> Bool
(QueryFilter -> QueryFilter -> Bool)
-> (QueryFilter -> QueryFilter -> Bool) -> Eq QueryFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: QueryFilter -> QueryFilter -> Bool
== :: QueryFilter -> QueryFilter -> Bool
$c/= :: QueryFilter -> QueryFilter -> Bool
/= :: QueryFilter -> QueryFilter -> Bool
Eq, Int -> QueryFilter -> ShowS
[QueryFilter] -> ShowS
QueryFilter -> String
(Int -> QueryFilter -> ShowS)
-> (QueryFilter -> String)
-> ([QueryFilter] -> ShowS)
-> Show QueryFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> QueryFilter -> ShowS
showsPrec :: Int -> QueryFilter -> ShowS
$cshow :: QueryFilter -> String
show :: QueryFilter -> String
$cshowList :: [QueryFilter] -> ShowS
showList :: [QueryFilter] -> ShowS
Show)

instance Storable QueryFilter where
  sizeOf :: QueryFilter -> Int
sizeOf QueryFilter
_ = (Int
16)
{-# LINE 1110 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 1111 "src/Box2D/Types.hsc" #-}
  peek p =
    QueryFilter
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1114 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1115 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (queryFilterCategoryBits x)
{-# LINE 1117 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (queryFilterMaskBits x)
{-# LINE 1118 "src/Box2D/Types.hsc" #-}

-- | A fully-initialised query filter (accept everything).
defaultQueryFilter :: IO QueryFilter
defaultQueryFilter :: IO QueryFilter
defaultQueryFilter = (Ptr QueryFilter -> IO ()) -> IO QueryFilter
forall a. Storable a => (Ptr a -> IO ()) -> IO a
allocaOut Ptr QueryFilter -> IO ()
c_b2DefaultQueryFilter

-- | The mass, centroid and rotational inertia of a shape or body.
data MassData = MassData
  { MassData -> Float
massDataMass               :: Float
  , MassData -> Vec2
massDataCenter             :: Vec2
  , MassData -> Float
massDataRotationalInertia  :: Float
  }
  deriving (MassData -> MassData -> Bool
(MassData -> MassData -> Bool)
-> (MassData -> MassData -> Bool) -> Eq MassData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MassData -> MassData -> Bool
== :: MassData -> MassData -> Bool
$c/= :: MassData -> MassData -> Bool
/= :: MassData -> MassData -> Bool
Eq, Int -> MassData -> ShowS
[MassData] -> ShowS
MassData -> String
(Int -> MassData -> ShowS)
-> (MassData -> String) -> ([MassData] -> ShowS) -> Show MassData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MassData -> ShowS
showsPrec :: Int -> MassData -> ShowS
$cshow :: MassData -> String
show :: MassData -> String
$cshowList :: [MassData] -> ShowS
showList :: [MassData] -> ShowS
Show)

instance Storable MassData where
  sizeOf :: MassData -> Int
sizeOf MassData
_ = (Int
16)
{-# LINE 1133 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 1134 "src/Box2D/Types.hsc" #-}
  peek p =
    MassData
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1137 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 4) p
{-# LINE 1138 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 12) p
{-# LINE 1139 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (massDataMass x)
{-# LINE 1141 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 4) p (massDataCenter x)
{-# LINE 1142 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 12) p (massDataRotationalInertia x)
{-# LINE 1143 "src/Box2D/Types.hsc" #-}

-- | Low-level ray-cast input in the local frame of the target shape.
data RayCastInput = RayCastInput
  { RayCastInput -> Vec2
rayCastInputOrigin      :: Vec2
  , RayCastInput -> Vec2
rayCastInputTranslation :: Vec2
  , RayCastInput -> Float
rayCastInputMaxFraction :: Float
  }
  deriving (RayCastInput -> RayCastInput -> Bool
(RayCastInput -> RayCastInput -> Bool)
-> (RayCastInput -> RayCastInput -> Bool) -> Eq RayCastInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RayCastInput -> RayCastInput -> Bool
== :: RayCastInput -> RayCastInput -> Bool
$c/= :: RayCastInput -> RayCastInput -> Bool
/= :: RayCastInput -> RayCastInput -> Bool
Eq, Int -> RayCastInput -> ShowS
[RayCastInput] -> ShowS
RayCastInput -> String
(Int -> RayCastInput -> ShowS)
-> (RayCastInput -> String)
-> ([RayCastInput] -> ShowS)
-> Show RayCastInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RayCastInput -> ShowS
showsPrec :: Int -> RayCastInput -> ShowS
$cshow :: RayCastInput -> String
show :: RayCastInput -> String
$cshowList :: [RayCastInput] -> ShowS
showList :: [RayCastInput] -> ShowS
Show)

instance Storable RayCastInput where
  sizeOf :: RayCastInput -> Int
sizeOf RayCastInput
_ = (Int
20)
{-# LINE 1154 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 1155 "src/Box2D/Types.hsc" #-}
  peek p =
    RayCastInput
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1158 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1159 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 1160 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (rayCastInputOrigin x)
{-# LINE 1162 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (rayCastInputTranslation x)
{-# LINE 1163 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p (rayCastInputMaxFraction x)
{-# LINE 1164 "src/Box2D/Types.hsc" #-}

-- | Low-level ray or shape-cast output, in the frame of the input. A zero
-- fraction and normal signal initial overlap.
data CastOutput = CastOutput
  { CastOutput -> Vec2
castOutputNormal     :: Vec2
  , CastOutput -> Vec2
castOutputPoint      :: Vec2
  , CastOutput -> Float
castOutputFraction   :: Float
  , CastOutput -> CInt
castOutputIterations :: CInt
  , CastOutput -> CBool
castOutputHit        :: CBool
  }
  deriving (CastOutput -> CastOutput -> Bool
(CastOutput -> CastOutput -> Bool)
-> (CastOutput -> CastOutput -> Bool) -> Eq CastOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CastOutput -> CastOutput -> Bool
== :: CastOutput -> CastOutput -> Bool
$c/= :: CastOutput -> CastOutput -> Bool
/= :: CastOutput -> CastOutput -> Bool
Eq, Int -> CastOutput -> ShowS
[CastOutput] -> ShowS
CastOutput -> String
(Int -> CastOutput -> ShowS)
-> (CastOutput -> String)
-> ([CastOutput] -> ShowS)
-> Show CastOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CastOutput -> ShowS
showsPrec :: Int -> CastOutput -> ShowS
$cshow :: CastOutput -> String
show :: CastOutput -> String
$cshowList :: [CastOutput] -> ShowS
showList :: [CastOutput] -> ShowS
Show)

instance Storable CastOutput where
  sizeOf :: CastOutput -> Int
sizeOf CastOutput
_ = (Int
28)
{-# LINE 1178 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 1179 "src/Box2D/Types.hsc" #-}
  peek p =
    CastOutput
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1182 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1183 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 1184 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 20) p
{-# LINE 1185 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 24) p
{-# LINE 1186 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (castOutputNormal x)
{-# LINE 1188 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (castOutputPoint x)
{-# LINE 1189 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p (castOutputFraction x)
{-# LINE 1190 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 20) p (castOutputIterations x)
{-# LINE 1191 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 24) p (castOutputHit x)
{-# LINE 1192 "src/Box2D/Types.hsc" #-}

-- | World-space cast output. In single-precision builds (the default) this is
-- the same struct as 'CastOutput'.
type WorldCastOutput = CastOutput

-- | The closest hit of a world ray cast ('Box2D.World.castRayClosest').
data RayResult = RayResult
  { RayResult -> ShapeId
rayResultShapeId    :: ShapeId
  , RayResult -> Vec2
rayResultPoint      :: Pos
  , RayResult -> Vec2
rayResultNormal     :: Vec2
  , RayResult -> Float
rayResultFraction   :: Float
  , RayResult -> CInt
rayResultNodeVisits :: CInt
  , RayResult -> CInt
rayResultLeafVisits :: CInt
  , RayResult -> CBool
rayResultHit        :: CBool
  }
  deriving (RayResult -> RayResult -> Bool
(RayResult -> RayResult -> Bool)
-> (RayResult -> RayResult -> Bool) -> Eq RayResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RayResult -> RayResult -> Bool
== :: RayResult -> RayResult -> Bool
$c/= :: RayResult -> RayResult -> Bool
/= :: RayResult -> RayResult -> Bool
Eq, Int -> RayResult -> ShowS
[RayResult] -> ShowS
RayResult -> String
(Int -> RayResult -> ShowS)
-> (RayResult -> String)
-> ([RayResult] -> ShowS)
-> Show RayResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RayResult -> ShowS
showsPrec :: Int -> RayResult -> ShowS
$cshow :: RayResult -> String
show :: RayResult -> String
$cshowList :: [RayResult] -> ShowS
showList :: [RayResult] -> ShowS
Show)

instance Storable RayResult where
  sizeOf :: RayResult -> Int
sizeOf RayResult
_ = (Int
40)
{-# LINE 1211 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 1212 "src/Box2D/Types.hsc" #-}
  peek p =
    RayResult
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1215 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1216 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 1217 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 24) p
{-# LINE 1218 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 28) p
{-# LINE 1219 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 32) p
{-# LINE 1220 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 36) p
{-# LINE 1221 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (rayResultShapeId x)
{-# LINE 1223 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (rayResultPoint x)
{-# LINE 1224 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p (rayResultNormal x)
{-# LINE 1225 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 24) p (rayResultFraction x)
{-# LINE 1226 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 28) p (rayResultNodeVisits x)
{-# LINE 1227 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 32) p (rayResultLeafVisits x)
{-# LINE 1228 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 36) p (rayResultHit x)
{-# LINE 1229 "src/Box2D/Types.hsc" #-}

-- | Broad-phase traversal counters for a query. Diagnostic.
data TreeStats = TreeStats
  { TreeStats -> CInt
treeStatsNodeVisits :: CInt
  , TreeStats -> CInt
treeStatsLeafVisits :: CInt
  }
  deriving (TreeStats -> TreeStats -> Bool
(TreeStats -> TreeStats -> Bool)
-> (TreeStats -> TreeStats -> Bool) -> Eq TreeStats
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TreeStats -> TreeStats -> Bool
== :: TreeStats -> TreeStats -> Bool
$c/= :: TreeStats -> TreeStats -> Bool
/= :: TreeStats -> TreeStats -> Bool
Eq, Int -> TreeStats -> ShowS
[TreeStats] -> ShowS
TreeStats -> String
(Int -> TreeStats -> ShowS)
-> (TreeStats -> String)
-> ([TreeStats] -> ShowS)
-> Show TreeStats
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TreeStats -> ShowS
showsPrec :: Int -> TreeStats -> ShowS
$cshow :: TreeStats -> String
show :: TreeStats -> String
$cshowList :: [TreeStats] -> ShowS
showList :: [TreeStats] -> ShowS
Show)

instance Storable TreeStats where
  sizeOf :: TreeStats -> Int
sizeOf TreeStats
_ = (Int
8)
{-# LINE 1239 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 1240 "src/Box2D/Types.hsc" #-}
  peek p =
    TreeStats
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1243 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 4) p
{-# LINE 1244 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (treeStatsNodeVisits x)
{-# LINE 1246 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 4) p (treeStatsLeafVisits x)
{-# LINE 1247 "src/Box2D/Types.hsc" #-}

-- | The motion of a body between two configurations, for TOI computation.
data Sweep = Sweep
  { Sweep -> Vec2
sweepLocalCenter :: Vec2
  , Sweep -> Vec2
sweepC1          :: Vec2
  , Sweep -> Vec2
sweepC2          :: Vec2
  , Sweep -> Rot
sweepQ1          :: Rot
  , Sweep -> Rot
sweepQ2          :: Rot
  }
  deriving (Sweep -> Sweep -> Bool
(Sweep -> Sweep -> Bool) -> (Sweep -> Sweep -> Bool) -> Eq Sweep
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Sweep -> Sweep -> Bool
== :: Sweep -> Sweep -> Bool
$c/= :: Sweep -> Sweep -> Bool
/= :: Sweep -> Sweep -> Bool
Eq, Int -> Sweep -> ShowS
[Sweep] -> ShowS
Sweep -> String
(Int -> Sweep -> ShowS)
-> (Sweep -> String) -> ([Sweep] -> ShowS) -> Show Sweep
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Sweep -> ShowS
showsPrec :: Int -> Sweep -> ShowS
$cshow :: Sweep -> String
show :: Sweep -> String
$cshowList :: [Sweep] -> ShowS
showList :: [Sweep] -> ShowS
Show)

instance Storable Sweep where
  sizeOf :: Sweep -> Int
sizeOf Sweep
_ = (Int
40)
{-# LINE 1260 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 1261 "src/Box2D/Types.hsc" #-}
  peek p =
    Sweep
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1264 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1265 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 1266 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 24) p
{-# LINE 1267 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 32) p
{-# LINE 1268 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (sweepLocalCenter x)
{-# LINE 1270 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (sweepC1 x)
{-# LINE 1271 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p (sweepC2 x)
{-# LINE 1272 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 24) p (sweepQ1 x)
{-# LINE 1273 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 32) p (sweepQ2 x)
{-# LINE 1274 "src/Box2D/Types.hsc" #-}

-- | One collision plane from 'Box2D.World.collideMover', relative to the
-- query origin. Ignore planes whose 'planeResultHit' is 0.
data PlaneResult = PlaneResult
  { PlaneResult -> Plane
planeResultPlane :: Plane
  , PlaneResult -> Vec2
planeResultPoint :: Vec2
  , PlaneResult -> CBool
planeResultHit   :: CBool
  }
  deriving (PlaneResult -> PlaneResult -> Bool
(PlaneResult -> PlaneResult -> Bool)
-> (PlaneResult -> PlaneResult -> Bool) -> Eq PlaneResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PlaneResult -> PlaneResult -> Bool
== :: PlaneResult -> PlaneResult -> Bool
$c/= :: PlaneResult -> PlaneResult -> Bool
/= :: PlaneResult -> PlaneResult -> Bool
Eq, Int -> PlaneResult -> ShowS
[PlaneResult] -> ShowS
PlaneResult -> String
(Int -> PlaneResult -> ShowS)
-> (PlaneResult -> String)
-> ([PlaneResult] -> ShowS)
-> Show PlaneResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PlaneResult -> ShowS
showsPrec :: Int -> PlaneResult -> ShowS
$cshow :: PlaneResult -> String
show :: PlaneResult -> String
$cshowList :: [PlaneResult] -> ShowS
showList :: [PlaneResult] -> ShowS
Show)

instance Storable PlaneResult where
  sizeOf :: PlaneResult -> Int
sizeOf PlaneResult
_ = (Int
24)
{-# LINE 1286 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 1287 "src/Box2D/Types.hsc" #-}
  peek p =
    PlaneResult
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1290 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 12) p
{-# LINE 1291 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 20) p
{-# LINE 1292 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (planeResultPlane x)
{-# LINE 1294 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 12) p (planeResultPoint x)
{-# LINE 1295 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 20) p (planeResultHit x)
{-# LINE 1296 "src/Box2D/Types.hsc" #-}

-- | The size of the (opaque) @b2DynamicTree@ struct, for allocating one to
-- initialise with 'Box2D.DynamicTree.create'.
dynamicTreeByteCount :: Int
dynamicTreeByteCount :: Int
dynamicTreeByteCount = (Int
72)
{-# LINE 1301 "src/Box2D/Types.hsc" #-}

-- Events ------------------------------------------------------------------

-- | A body move event: the new transform of a body that moved this step.
-- Enabled per body via 'bodyDefIsAwake' / motion; read after 'Box2D.World.step'
-- and before the next step (see "Box2D.Events").
data BodyMoveEvent = BodyMoveEvent
  { BodyMoveEvent -> Ptr ()
bodyMoveEventUserData   :: Ptr ()
  , BodyMoveEvent -> Transform
bodyMoveEventTransform  :: Transform
  , BodyMoveEvent -> BodyId
bodyMoveEventBodyId     :: BodyId
  , BodyMoveEvent -> CBool
bodyMoveEventFellAsleep :: CBool
  }
  deriving (BodyMoveEvent -> BodyMoveEvent -> Bool
(BodyMoveEvent -> BodyMoveEvent -> Bool)
-> (BodyMoveEvent -> BodyMoveEvent -> Bool) -> Eq BodyMoveEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BodyMoveEvent -> BodyMoveEvent -> Bool
== :: BodyMoveEvent -> BodyMoveEvent -> Bool
$c/= :: BodyMoveEvent -> BodyMoveEvent -> Bool
/= :: BodyMoveEvent -> BodyMoveEvent -> Bool
Eq, Int -> BodyMoveEvent -> ShowS
[BodyMoveEvent] -> ShowS
BodyMoveEvent -> String
(Int -> BodyMoveEvent -> ShowS)
-> (BodyMoveEvent -> String)
-> ([BodyMoveEvent] -> ShowS)
-> Show BodyMoveEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BodyMoveEvent -> ShowS
showsPrec :: Int -> BodyMoveEvent -> ShowS
$cshow :: BodyMoveEvent -> String
show :: BodyMoveEvent -> String
$cshowList :: [BodyMoveEvent] -> ShowS
showList :: [BodyMoveEvent] -> ShowS
Show)

instance Storable BodyMoveEvent where
  sizeOf :: BodyMoveEvent -> Int
sizeOf BodyMoveEvent
_ = (Int
40)
{-# LINE 1317 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 1318 "src/Box2D/Types.hsc" #-}
  peek p =
    BodyMoveEvent
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1321 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1322 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 24) p
{-# LINE 1323 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 32) p
{-# LINE 1324 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (bodyMoveEventUserData x)
{-# LINE 1326 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (bodyMoveEventTransform x)
{-# LINE 1327 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 24) p (bodyMoveEventBodyId x)
{-# LINE 1328 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 32) p (bodyMoveEventFellAsleep x)
{-# LINE 1329 "src/Box2D/Types.hsc" #-}

-- | Body events buffer: a C-owned array of 'BodyMoveEvent' valid until the
-- next 'Box2D.World.step'. Marshalled to a list by "Box2D.Events".
data BodyEvents = BodyEvents
  { BodyEvents -> Ptr BodyMoveEvent
bodyEventsMoveEvents :: Ptr BodyMoveEvent
  , BodyEvents -> CInt
bodyEventsMoveCount  :: CInt
  }
  deriving (BodyEvents -> BodyEvents -> Bool
(BodyEvents -> BodyEvents -> Bool)
-> (BodyEvents -> BodyEvents -> Bool) -> Eq BodyEvents
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BodyEvents -> BodyEvents -> Bool
== :: BodyEvents -> BodyEvents -> Bool
$c/= :: BodyEvents -> BodyEvents -> Bool
/= :: BodyEvents -> BodyEvents -> Bool
Eq, Int -> BodyEvents -> ShowS
[BodyEvents] -> ShowS
BodyEvents -> String
(Int -> BodyEvents -> ShowS)
-> (BodyEvents -> String)
-> ([BodyEvents] -> ShowS)
-> Show BodyEvents
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BodyEvents -> ShowS
showsPrec :: Int -> BodyEvents -> ShowS
$cshow :: BodyEvents -> String
show :: BodyEvents -> String
$cshowList :: [BodyEvents] -> ShowS
showList :: [BodyEvents] -> ShowS
Show)

instance Storable BodyEvents where
  sizeOf :: BodyEvents -> Int
sizeOf BodyEvents
_ = (Int
16)
{-# LINE 1340 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 1341 "src/Box2D/Types.hsc" #-}
  peek p =
    BodyEvents
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1344 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1345 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (bodyEventsMoveEvents x)
{-# LINE 1347 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (bodyEventsMoveCount x)
{-# LINE 1348 "src/Box2D/Types.hsc" #-}

-- | A shape started overlapping a sensor shape.
data SensorBeginTouchEvent = SensorBeginTouchEvent
  { SensorBeginTouchEvent -> ShapeId
sensorBeginTouchEventSensorShapeId  :: ShapeId
  , SensorBeginTouchEvent -> ShapeId
sensorBeginTouchEventVisitorShapeId :: ShapeId
  }
  deriving (SensorBeginTouchEvent -> SensorBeginTouchEvent -> Bool
(SensorBeginTouchEvent -> SensorBeginTouchEvent -> Bool)
-> (SensorBeginTouchEvent -> SensorBeginTouchEvent -> Bool)
-> Eq SensorBeginTouchEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SensorBeginTouchEvent -> SensorBeginTouchEvent -> Bool
== :: SensorBeginTouchEvent -> SensorBeginTouchEvent -> Bool
$c/= :: SensorBeginTouchEvent -> SensorBeginTouchEvent -> Bool
/= :: SensorBeginTouchEvent -> SensorBeginTouchEvent -> Bool
Eq, Int -> SensorBeginTouchEvent -> ShowS
[SensorBeginTouchEvent] -> ShowS
SensorBeginTouchEvent -> String
(Int -> SensorBeginTouchEvent -> ShowS)
-> (SensorBeginTouchEvent -> String)
-> ([SensorBeginTouchEvent] -> ShowS)
-> Show SensorBeginTouchEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SensorBeginTouchEvent -> ShowS
showsPrec :: Int -> SensorBeginTouchEvent -> ShowS
$cshow :: SensorBeginTouchEvent -> String
show :: SensorBeginTouchEvent -> String
$cshowList :: [SensorBeginTouchEvent] -> ShowS
showList :: [SensorBeginTouchEvent] -> ShowS
Show)

instance Storable SensorBeginTouchEvent where
  sizeOf :: SensorBeginTouchEvent -> Int
sizeOf SensorBeginTouchEvent
_ = (Int
16)
{-# LINE 1358 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 1359 "src/Box2D/Types.hsc" #-}
  peek p =
    SensorBeginTouchEvent
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1362 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1363 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (sensorBeginTouchEventSensorShapeId x)
{-# LINE 1365 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (sensorBeginTouchEventVisitorShapeId x)
{-# LINE 1366 "src/Box2D/Types.hsc" #-}

-- | A shape stopped overlapping a sensor shape. Either shape may already be
-- destroyed; check with @Box2D.Shape.isValid@.
data SensorEndTouchEvent = SensorEndTouchEvent
  { SensorEndTouchEvent -> ShapeId
sensorEndTouchEventSensorShapeId  :: ShapeId
  , SensorEndTouchEvent -> ShapeId
sensorEndTouchEventVisitorShapeId :: ShapeId
  }
  deriving (SensorEndTouchEvent -> SensorEndTouchEvent -> Bool
(SensorEndTouchEvent -> SensorEndTouchEvent -> Bool)
-> (SensorEndTouchEvent -> SensorEndTouchEvent -> Bool)
-> Eq SensorEndTouchEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SensorEndTouchEvent -> SensorEndTouchEvent -> Bool
== :: SensorEndTouchEvent -> SensorEndTouchEvent -> Bool
$c/= :: SensorEndTouchEvent -> SensorEndTouchEvent -> Bool
/= :: SensorEndTouchEvent -> SensorEndTouchEvent -> Bool
Eq, Int -> SensorEndTouchEvent -> ShowS
[SensorEndTouchEvent] -> ShowS
SensorEndTouchEvent -> String
(Int -> SensorEndTouchEvent -> ShowS)
-> (SensorEndTouchEvent -> String)
-> ([SensorEndTouchEvent] -> ShowS)
-> Show SensorEndTouchEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SensorEndTouchEvent -> ShowS
showsPrec :: Int -> SensorEndTouchEvent -> ShowS
$cshow :: SensorEndTouchEvent -> String
show :: SensorEndTouchEvent -> String
$cshowList :: [SensorEndTouchEvent] -> ShowS
showList :: [SensorEndTouchEvent] -> ShowS
Show)

instance Storable SensorEndTouchEvent where
  sizeOf :: SensorEndTouchEvent -> Int
sizeOf SensorEndTouchEvent
_ = (Int
16)
{-# LINE 1377 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 1378 "src/Box2D/Types.hsc" #-}
  peek p =
    SensorEndTouchEvent
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1381 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1382 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (sensorEndTouchEventSensorShapeId x)
{-# LINE 1384 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (sensorEndTouchEventVisitorShapeId x)
{-# LINE 1385 "src/Box2D/Types.hsc" #-}

-- | Sensor events buffer: C-owned begin/end arrays valid until the next
-- 'Box2D.World.step'. Marshalled to lists by "Box2D.Events".
data SensorEvents = SensorEvents
  { SensorEvents -> Ptr SensorBeginTouchEvent
sensorEventsBeginEvents :: Ptr SensorBeginTouchEvent
  , SensorEvents -> Ptr SensorEndTouchEvent
sensorEventsEndEvents   :: Ptr SensorEndTouchEvent
  , SensorEvents -> CInt
sensorEventsBeginCount  :: CInt
  , SensorEvents -> CInt
sensorEventsEndCount    :: CInt
  }
  deriving (SensorEvents -> SensorEvents -> Bool
(SensorEvents -> SensorEvents -> Bool)
-> (SensorEvents -> SensorEvents -> Bool) -> Eq SensorEvents
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SensorEvents -> SensorEvents -> Bool
== :: SensorEvents -> SensorEvents -> Bool
$c/= :: SensorEvents -> SensorEvents -> Bool
/= :: SensorEvents -> SensorEvents -> Bool
Eq, Int -> SensorEvents -> ShowS
[SensorEvents] -> ShowS
SensorEvents -> String
(Int -> SensorEvents -> ShowS)
-> (SensorEvents -> String)
-> ([SensorEvents] -> ShowS)
-> Show SensorEvents
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SensorEvents -> ShowS
showsPrec :: Int -> SensorEvents -> ShowS
$cshow :: SensorEvents -> String
show :: SensorEvents -> String
$cshowList :: [SensorEvents] -> ShowS
showList :: [SensorEvents] -> ShowS
Show)

instance Storable SensorEvents where
  sizeOf :: SensorEvents -> Int
sizeOf SensorEvents
_ = (Int
24)
{-# LINE 1398 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 1399 "src/Box2D/Types.hsc" #-}
  peek p =
    SensorEvents
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1402 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1403 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 1404 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 20) p
{-# LINE 1405 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (sensorEventsBeginEvents x)
{-# LINE 1407 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (sensorEventsEndEvents x)
{-# LINE 1408 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p (sensorEventsBeginCount x)
{-# LINE 1409 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 20) p (sensorEventsEndCount x)
{-# LINE 1410 "src/Box2D/Types.hsc" #-}

-- | Two shapes began touching.
data ContactBeginTouchEvent = ContactBeginTouchEvent
  { ContactBeginTouchEvent -> ShapeId
contactBeginTouchEventShapeIdA  :: ShapeId
  , ContactBeginTouchEvent -> ShapeId
contactBeginTouchEventShapeIdB  :: ShapeId
  , ContactBeginTouchEvent -> ContactId
contactBeginTouchEventContactId :: ContactId
  }
  deriving (ContactBeginTouchEvent -> ContactBeginTouchEvent -> Bool
(ContactBeginTouchEvent -> ContactBeginTouchEvent -> Bool)
-> (ContactBeginTouchEvent -> ContactBeginTouchEvent -> Bool)
-> Eq ContactBeginTouchEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ContactBeginTouchEvent -> ContactBeginTouchEvent -> Bool
== :: ContactBeginTouchEvent -> ContactBeginTouchEvent -> Bool
$c/= :: ContactBeginTouchEvent -> ContactBeginTouchEvent -> Bool
/= :: ContactBeginTouchEvent -> ContactBeginTouchEvent -> Bool
Eq, Int -> ContactBeginTouchEvent -> ShowS
[ContactBeginTouchEvent] -> ShowS
ContactBeginTouchEvent -> String
(Int -> ContactBeginTouchEvent -> ShowS)
-> (ContactBeginTouchEvent -> String)
-> ([ContactBeginTouchEvent] -> ShowS)
-> Show ContactBeginTouchEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ContactBeginTouchEvent -> ShowS
showsPrec :: Int -> ContactBeginTouchEvent -> ShowS
$cshow :: ContactBeginTouchEvent -> String
show :: ContactBeginTouchEvent -> String
$cshowList :: [ContactBeginTouchEvent] -> ShowS
showList :: [ContactBeginTouchEvent] -> ShowS
Show)

instance Storable ContactBeginTouchEvent where
  sizeOf :: ContactBeginTouchEvent -> Int
sizeOf ContactBeginTouchEvent
_ = (Int
28)
{-# LINE 1421 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 1422 "src/Box2D/Types.hsc" #-}
  peek p =
    ContactBeginTouchEvent
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1425 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1426 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 1427 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (contactBeginTouchEventShapeIdA x)
{-# LINE 1429 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (contactBeginTouchEventShapeIdB x)
{-# LINE 1430 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p (contactBeginTouchEventContactId x)
{-# LINE 1431 "src/Box2D/Types.hsc" #-}

-- | Two shapes stopped touching. The shapes and the contact may already be
-- destroyed; check with the respective @isValid@.
data ContactEndTouchEvent = ContactEndTouchEvent
  { ContactEndTouchEvent -> ShapeId
contactEndTouchEventShapeIdA  :: ShapeId
  , ContactEndTouchEvent -> ShapeId
contactEndTouchEventShapeIdB  :: ShapeId
  , ContactEndTouchEvent -> ContactId
contactEndTouchEventContactId :: ContactId
  }
  deriving (ContactEndTouchEvent -> ContactEndTouchEvent -> Bool
(ContactEndTouchEvent -> ContactEndTouchEvent -> Bool)
-> (ContactEndTouchEvent -> ContactEndTouchEvent -> Bool)
-> Eq ContactEndTouchEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ContactEndTouchEvent -> ContactEndTouchEvent -> Bool
== :: ContactEndTouchEvent -> ContactEndTouchEvent -> Bool
$c/= :: ContactEndTouchEvent -> ContactEndTouchEvent -> Bool
/= :: ContactEndTouchEvent -> ContactEndTouchEvent -> Bool
Eq, Int -> ContactEndTouchEvent -> ShowS
[ContactEndTouchEvent] -> ShowS
ContactEndTouchEvent -> String
(Int -> ContactEndTouchEvent -> ShowS)
-> (ContactEndTouchEvent -> String)
-> ([ContactEndTouchEvent] -> ShowS)
-> Show ContactEndTouchEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ContactEndTouchEvent -> ShowS
showsPrec :: Int -> ContactEndTouchEvent -> ShowS
$cshow :: ContactEndTouchEvent -> String
show :: ContactEndTouchEvent -> String
$cshowList :: [ContactEndTouchEvent] -> ShowS
showList :: [ContactEndTouchEvent] -> ShowS
Show)

instance Storable ContactEndTouchEvent where
  sizeOf :: ContactEndTouchEvent -> Int
sizeOf ContactEndTouchEvent
_ = (Int
28)
{-# LINE 1443 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 1444 "src/Box2D/Types.hsc" #-}
  peek p =
    ContactEndTouchEvent
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1447 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1448 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 1449 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (contactEndTouchEventShapeIdA x)
{-# LINE 1451 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (contactEndTouchEventShapeIdB x)
{-# LINE 1452 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p (contactEndTouchEventContactId x)
{-# LINE 1453 "src/Box2D/Types.hsc" #-}

-- | Two shapes collided faster than the hit speed threshold
-- (@worldDefHitEventThreshold@; hit events must be enabled per shape).
data ContactHitEvent = ContactHitEvent
  { ContactHitEvent -> ShapeId
contactHitEventShapeIdA      :: ShapeId
  , ContactHitEvent -> ShapeId
contactHitEventShapeIdB      :: ShapeId
  , ContactHitEvent -> ContactId
contactHitEventContactId     :: ContactId
  , ContactHitEvent -> Vec2
contactHitEventPoint         :: Pos
  , ContactHitEvent -> Vec2
contactHitEventNormal        :: Vec2
  , ContactHitEvent -> Float
contactHitEventApproachSpeed :: Float
  }
  deriving (ContactHitEvent -> ContactHitEvent -> Bool
(ContactHitEvent -> ContactHitEvent -> Bool)
-> (ContactHitEvent -> ContactHitEvent -> Bool)
-> Eq ContactHitEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ContactHitEvent -> ContactHitEvent -> Bool
== :: ContactHitEvent -> ContactHitEvent -> Bool
$c/= :: ContactHitEvent -> ContactHitEvent -> Bool
/= :: ContactHitEvent -> ContactHitEvent -> Bool
Eq, Int -> ContactHitEvent -> ShowS
[ContactHitEvent] -> ShowS
ContactHitEvent -> String
(Int -> ContactHitEvent -> ShowS)
-> (ContactHitEvent -> String)
-> ([ContactHitEvent] -> ShowS)
-> Show ContactHitEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ContactHitEvent -> ShowS
showsPrec :: Int -> ContactHitEvent -> ShowS
$cshow :: ContactHitEvent -> String
show :: ContactHitEvent -> String
$cshowList :: [ContactHitEvent] -> ShowS
showList :: [ContactHitEvent] -> ShowS
Show)

instance Storable ContactHitEvent where
  sizeOf :: ContactHitEvent -> Int
sizeOf ContactHitEvent
_ = (Int
48)
{-# LINE 1468 "src/Box2D/Types.hsc" #-}
  alignment _ = 4
{-# LINE 1469 "src/Box2D/Types.hsc" #-}
  peek p =
    ContactHitEvent
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1472 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1473 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 1474 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 28) p
{-# LINE 1475 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 36) p
{-# LINE 1476 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 44) p
{-# LINE 1477 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (contactHitEventShapeIdA x)
{-# LINE 1479 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (contactHitEventShapeIdB x)
{-# LINE 1480 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p (contactHitEventContactId x)
{-# LINE 1481 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 28) p (contactHitEventPoint x)
{-# LINE 1482 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 36) p (contactHitEventNormal x)
{-# LINE 1483 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 44) p (contactHitEventApproachSpeed x)
{-# LINE 1484 "src/Box2D/Types.hsc" #-}

-- | Contact events buffer: C-owned begin/end/hit arrays valid until the next
-- 'Box2D.World.step'. Marshalled to lists by "Box2D.Events".
data ContactEvents = ContactEvents
  { ContactEvents -> Ptr ContactBeginTouchEvent
contactEventsBeginEvents :: Ptr ContactBeginTouchEvent
  , ContactEvents -> Ptr ContactEndTouchEvent
contactEventsEndEvents   :: Ptr ContactEndTouchEvent
  , ContactEvents -> Ptr ContactHitEvent
contactEventsHitEvents   :: Ptr ContactHitEvent
  , ContactEvents -> CInt
contactEventsBeginCount  :: CInt
  , ContactEvents -> CInt
contactEventsEndCount    :: CInt
  , ContactEvents -> CInt
contactEventsHitCount    :: CInt
  }
  deriving (ContactEvents -> ContactEvents -> Bool
(ContactEvents -> ContactEvents -> Bool)
-> (ContactEvents -> ContactEvents -> Bool) -> Eq ContactEvents
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ContactEvents -> ContactEvents -> Bool
== :: ContactEvents -> ContactEvents -> Bool
$c/= :: ContactEvents -> ContactEvents -> Bool
/= :: ContactEvents -> ContactEvents -> Bool
Eq, Int -> ContactEvents -> ShowS
[ContactEvents] -> ShowS
ContactEvents -> String
(Int -> ContactEvents -> ShowS)
-> (ContactEvents -> String)
-> ([ContactEvents] -> ShowS)
-> Show ContactEvents
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ContactEvents -> ShowS
showsPrec :: Int -> ContactEvents -> ShowS
$cshow :: ContactEvents -> String
show :: ContactEvents -> String
$cshowList :: [ContactEvents] -> ShowS
showList :: [ContactEvents] -> ShowS
Show)

instance Storable ContactEvents where
  sizeOf :: ContactEvents -> Int
sizeOf ContactEvents
_ = (Int
40)
{-# LINE 1499 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 1500 "src/Box2D/Types.hsc" #-}
  peek p =
    ContactEvents
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1503 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1504 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 16) p
{-# LINE 1505 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 24) p
{-# LINE 1506 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 28) p
{-# LINE 1507 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 32) p
{-# LINE 1508 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (contactEventsBeginEvents x)
{-# LINE 1510 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (contactEventsEndEvents x)
{-# LINE 1511 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 16) p (contactEventsHitEvents x)
{-# LINE 1512 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 24) p (contactEventsBeginCount x)
{-# LINE 1513 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 28) p (contactEventsEndCount x)
{-# LINE 1514 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 32) p (contactEventsHitCount x)
{-# LINE 1515 "src/Box2D/Types.hsc" #-}

-- | A joint exceeded its force/torque event threshold this step.
data JointEvent = JointEvent
  { JointEvent -> JointId
jointEventJointId  :: JointId
  , JointEvent -> Ptr ()
jointEventUserData :: Ptr ()
  }
  deriving (JointEvent -> JointEvent -> Bool
(JointEvent -> JointEvent -> Bool)
-> (JointEvent -> JointEvent -> Bool) -> Eq JointEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JointEvent -> JointEvent -> Bool
== :: JointEvent -> JointEvent -> Bool
$c/= :: JointEvent -> JointEvent -> Bool
/= :: JointEvent -> JointEvent -> Bool
Eq, Int -> JointEvent -> ShowS
[JointEvent] -> ShowS
JointEvent -> String
(Int -> JointEvent -> ShowS)
-> (JointEvent -> String)
-> ([JointEvent] -> ShowS)
-> Show JointEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> JointEvent -> ShowS
showsPrec :: Int -> JointEvent -> ShowS
$cshow :: JointEvent -> String
show :: JointEvent -> String
$cshowList :: [JointEvent] -> ShowS
showList :: [JointEvent] -> ShowS
Show)

instance Storable JointEvent where
  sizeOf :: JointEvent -> Int
sizeOf JointEvent
_ = (Int
16)
{-# LINE 1525 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 1526 "src/Box2D/Types.hsc" #-}
  peek p =
    JointEvent
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1529 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1530 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (jointEventJointId x)
{-# LINE 1532 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (jointEventUserData x)
{-# LINE 1533 "src/Box2D/Types.hsc" #-}

-- | Joint events buffer: a C-owned array of 'JointEvent' valid until the next
-- 'Box2D.World.step'. Marshalled to a list by "Box2D.Events".
data JointEvents = JointEvents
  { JointEvents -> Ptr JointEvent
jointEventsJointEvents :: Ptr JointEvent
  , JointEvents -> CInt
jointEventsCount       :: CInt
  }
  deriving (JointEvents -> JointEvents -> Bool
(JointEvents -> JointEvents -> Bool)
-> (JointEvents -> JointEvents -> Bool) -> Eq JointEvents
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JointEvents -> JointEvents -> Bool
== :: JointEvents -> JointEvents -> Bool
$c/= :: JointEvents -> JointEvents -> Bool
/= :: JointEvents -> JointEvents -> Bool
Eq, Int -> JointEvents -> ShowS
[JointEvents] -> ShowS
JointEvents -> String
(Int -> JointEvents -> ShowS)
-> (JointEvents -> String)
-> ([JointEvents] -> ShowS)
-> Show JointEvents
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> JointEvents -> ShowS
showsPrec :: Int -> JointEvents -> ShowS
$cshow :: JointEvents -> String
show :: JointEvents -> String
$cshowList :: [JointEvents] -> ShowS
showList :: [JointEvents] -> ShowS
Show)

instance Storable JointEvents where
  sizeOf :: JointEvents -> Int
sizeOf JointEvents
_ = (Int
16)
{-# LINE 1544 "src/Box2D/Types.hsc" #-}
  alignment _ = 8
{-# LINE 1545 "src/Box2D/Types.hsc" #-}
  peek p =
    JointEvents
      <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 1548 "src/Box2D/Types.hsc" #-}
      <*> (\hsc_ptr -> peekByteOff hsc_ptr 8) p
{-# LINE 1549 "src/Box2D/Types.hsc" #-}
  poke p x = do
    (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (jointEventsJointEvents x)
{-# LINE 1551 "src/Box2D/Types.hsc" #-}
    (\hsc_ptr -> pokeByteOff hsc_ptr 8) p (jointEventsCount x)
{-# LINE 1552 "src/Box2D/Types.hsc" #-}