| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Box2D.Chain
Synopsis
- create :: BodyId -> ChainDef -> IO ChainId
- destroy :: ChainId -> IO ()
- getWorld :: ChainId -> IO WorldId
- getSegmentCount :: ChainId -> IO Int
- getSegments :: ChainId -> Ptr ShapeId -> Int -> IO Int
- getSurfaceMaterialCount :: ChainId -> IO Int
- setSurfaceMaterial :: ChainId -> SurfaceMaterial -> Int -> IO ()
- getSurfaceMaterial :: ChainId -> Int -> IO SurfaceMaterial
- getSurfaceMaterialInto :: ChainId -> Int -> Ptr SurfaceMaterial -> IO ()
- isValid :: ChainId -> IO Bool
Documentation
create :: BodyId -> ChainDef -> IO ChainId Source #
Create a chain shape See also b2ChainDef for details.
Binds b2CreateChain.
getWorld :: ChainId -> IO WorldId Source #
Get the world that owns this chain shape
Binds b2Chain_GetWorld.
getSegmentCount :: ChainId -> IO Int Source #
Get the number of segments on this chain
Binds b2Chain_GetSegmentCount.
Fill a user array with chain segment shape ids up to the specified capacity. Returns the actual number of segments returned.
Binds b2Chain_GetSegments.
getSurfaceMaterialCount :: ChainId -> IO Int Source #
Get the number of materials used on this chain. Must be 1 or the number of segments.
Binds b2Chain_GetSurfaceMaterialCount.
Arguments
| :: ChainId | |
| -> SurfaceMaterial | |
| -> Int | materialIndex |
| -> IO () |
Set a chain material. If the chain has only one material, this material is applied to all segments. Otherwise it is applied to a single segment.
Binds b2Chain_SetSurfaceMaterial.
Arguments
| :: ChainId | |
| -> Int | materialIndex |
| -> IO SurfaceMaterial |
Get a chain material by index.
Binds b2Chain_GetSurfaceMaterial.
getSurfaceMaterialInto Source #
Arguments
| :: ChainId | |
| -> Int | materialIndex |
| -> Ptr SurfaceMaterial | Result buffer. |
| -> IO () |
Like getSurfaceMaterial, but the result is written into a caller-supplied buffer.