Box2D
Safe HaskellNone
LanguageGHC2021

Box2D.Chain

Synopsis

Documentation

create :: BodyId -> ChainDef -> IO ChainId Source #

Create a chain shape See also b2ChainDef for details.

Binds b2CreateChain.

destroy :: ChainId -> IO () Source #

Destroy a chain shape

Binds b2DestroyChain.

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.

getSegments Source #

Arguments

:: ChainId 
-> Ptr ShapeId
segmentArray
-> Int
capacity
-> IO Int 

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.

setSurfaceMaterial Source #

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.

getSurfaceMaterial Source #

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.

isValid :: ChainId -> IO Bool Source #

Chain identifier validation. Provides validation for up to 64K allocations.

Binds b2Chain_IsValid.