Box2D
Safe HaskellNone
LanguageGHC2021

Box2D.Joint

Synopsis

Documentation

destroy Source #

Arguments

:: JointId 
-> Bool
wakeAttached
-> IO () 

Destroy a joint. Optionally wake attached bodies.

Binds b2DestroyJoint.

isValid :: JointId -> IO Bool Source #

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

Binds b2Joint_IsValid.

getType :: JointId -> IO JointType Source #

Get the joint type

Binds b2Joint_GetType.

getBodyA :: JointId -> IO BodyId Source #

Get body A id on a joint

Binds b2Joint_GetBodyA.

getBodyB :: JointId -> IO BodyId Source #

Get body B id on a joint

Binds b2Joint_GetBodyB.

getWorld :: JointId -> IO WorldId Source #

Get the world that owns this joint

Binds b2Joint_GetWorld.

setLocalFrameA Source #

Arguments

:: JointId 
-> Transform
localFrame
-> IO () 

Set the local frame on bodyA

Binds b2Joint_SetLocalFrameA.

getLocalFrameA :: JointId -> IO Transform Source #

Get the local frame on bodyA

Binds b2Joint_GetLocalFrameA.

getLocalFrameAInto Source #

Arguments

:: JointId 
-> Ptr Transform

Result buffer.

-> IO () 

Like getLocalFrameA, but the result is written into a caller-supplied buffer.

setLocalFrameB Source #

Arguments

:: JointId 
-> Transform
localFrame
-> IO () 

Set the local frame on bodyB

Binds b2Joint_SetLocalFrameB.

getLocalFrameB :: JointId -> IO Transform Source #

Get the local frame on bodyB

Binds b2Joint_GetLocalFrameB.

getLocalFrameBInto Source #

Arguments

:: JointId 
-> Ptr Transform

Result buffer.

-> IO () 

Like getLocalFrameB, but the result is written into a caller-supplied buffer.

setCollideConnected Source #

Arguments

:: JointId 
-> Bool
shouldCollide
-> IO () 

Toggle collision between connected bodies

Binds b2Joint_SetCollideConnected.

getCollideConnected :: JointId -> IO Bool Source #

Is collision allowed between connected bodies?

Binds b2Joint_GetCollideConnected.

setUserData Source #

Arguments

:: JointId 
-> Ptr ()
userData
-> IO () 

Set the user data on a joint

Binds b2Joint_SetUserData.

getUserData :: JointId -> IO (Ptr ()) Source #

Get the user data on a joint

Binds b2Joint_GetUserData.

wakeBodies :: JointId -> IO () Source #

Wake the bodies connect to this joint

Binds b2Joint_WakeBodies.

getConstraintForce :: JointId -> IO Vec2 Source #

Get the current constraint force for this joint. Usually in Newtons.

Binds b2Joint_GetConstraintForce.

getConstraintForceInto Source #

Arguments

:: JointId 
-> Ptr Vec2

Result buffer.

-> IO () 

Like getConstraintForce, but the result is written into a caller-supplied buffer.

getConstraintTorque :: JointId -> IO Float Source #

Get the current constraint torque for this joint. Usually in Newton * meters.

Binds b2Joint_GetConstraintTorque.

getLinearSeparation :: JointId -> IO Float Source #

Get the current linear separation error for this joint. Does not consider admissible movement. Usually in meters.

Binds b2Joint_GetLinearSeparation.

getAngularSeparation :: JointId -> IO Float Source #

Get the current angular separation error for this joint. Does not consider admissible movement. Usually in meters.

Binds b2Joint_GetAngularSeparation.

setConstraintTuning Source #

Arguments

:: JointId

jointId: the joint

-> Float

hertz: the stiffness in Hertz (cycles per second)

-> Float

dampingRatio: the non-dimensional damping ratio (one for critical damping)

-> IO () 

Set the joint constraint tuning. Advanced feature.

Binds b2Joint_SetConstraintTuning.

getConstraintTuning Source #

Arguments

:: JointId 
-> Ptr Float
hertz
-> Ptr Float
dampingRatio
-> IO () 

Get the joint constraint tuning. Advanced feature.

Binds b2Joint_GetConstraintTuning.

setForceThreshold Source #

Arguments

:: JointId 
-> Float
threshold
-> IO () 

Set the force threshold for joint events (Newtons)

Binds b2Joint_SetForceThreshold.

getForceThreshold :: JointId -> IO Float Source #

Get the force threshold for joint events (Newtons)

Binds b2Joint_GetForceThreshold.

setTorqueThreshold Source #

Arguments

:: JointId 
-> Float
threshold
-> IO () 

Set the torque threshold for joint events (N-m)

Binds b2Joint_SetTorqueThreshold.

getTorqueThreshold :: JointId -> IO Float Source #

Get the torque threshold for joint events (N-m)

Binds b2Joint_GetTorqueThreshold.