Chipmunk2D Pro API Reference  7.0.2
 All Classes Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Typedefs | Functions
cpConstraint

Typedefs

typedef void(* cpConstraintPreSolveFunc )(cpConstraint *constraint, cpSpace *space)
 Callback function type that gets called before solving a joint.
 
typedef void(* cpConstraintPostSolveFunc )(cpConstraint *constraint, cpSpace *space)
 Callback function type that gets called after solving a joint.
 

Functions

CP_EXPORT void cpConstraintDestroy (cpConstraint *constraint)
 Destroy a constraint.
 
CP_EXPORT void cpConstraintFree (cpConstraint *constraint)
 Destroy and free a constraint.
 
CP_EXPORT cpSpacecpConstraintGetSpace (const cpConstraint *constraint)
 Get the cpSpace this constraint is added to.
 
CP_EXPORT cpBodycpConstraintGetBodyA (const cpConstraint *constraint)
 Get the first body the constraint is attached to.
 
CP_EXPORT cpBodycpConstraintGetBodyB (const cpConstraint *constraint)
 Get the second body the constraint is attached to.
 
CP_EXPORT cpFloat cpConstraintGetMaxForce (const cpConstraint *constraint)
 Get the maximum force that this constraint is allowed to use.
 
CP_EXPORT void cpConstraintSetMaxForce (cpConstraint *constraint, cpFloat maxForce)
 Set the maximum force that this constraint is allowed to use. (defaults to INFINITY)
 
CP_EXPORT cpFloat cpConstraintGetErrorBias (const cpConstraint *constraint)
 Get rate at which joint error is corrected.
 
CP_EXPORT void cpConstraintSetErrorBias (cpConstraint *constraint, cpFloat errorBias)
 Set rate at which joint error is corrected. More...
 
CP_EXPORT cpFloat cpConstraintGetMaxBias (const cpConstraint *constraint)
 Get the maximum rate at which joint error is corrected.
 
CP_EXPORT void cpConstraintSetMaxBias (cpConstraint *constraint, cpFloat maxBias)
 Set the maximum rate at which joint error is corrected. (defaults to INFINITY)
 
CP_EXPORT cpBool cpConstraintGetCollideBodies (const cpConstraint *constraint)
 Get if the two bodies connected by the constraint are allowed to collide or not.
 
CP_EXPORT void cpConstraintSetCollideBodies (cpConstraint *constraint, cpBool collideBodies)
 Set if the two bodies connected by the constraint are allowed to collide or not. (defaults to cpFalse)
 
CP_EXPORT cpConstraintPreSolveFunc cpConstraintGetPreSolveFunc (const cpConstraint *constraint)
 Get the pre-solve function that is called before the solver runs.
 
CP_EXPORT void cpConstraintSetPreSolveFunc (cpConstraint *constraint, cpConstraintPreSolveFunc preSolveFunc)
 Set the pre-solve function that is called before the solver runs.
 
CP_EXPORT cpConstraintPostSolveFunc cpConstraintGetPostSolveFunc (const cpConstraint *constraint)
 Get the post-solve function that is called before the solver runs.
 
CP_EXPORT void cpConstraintSetPostSolveFunc (cpConstraint *constraint, cpConstraintPostSolveFunc postSolveFunc)
 Set the post-solve function that is called before the solver runs.
 
CP_EXPORT cpDataPointer cpConstraintGetUserData (const cpConstraint *constraint)
 Get the user definable data pointer for this constraint.
 
CP_EXPORT void cpConstraintSetUserData (cpConstraint *constraint, cpDataPointer userData)
 Set the user definable data pointer for this constraint.
 
CP_EXPORT cpFloat cpConstraintGetImpulse (cpConstraint *constraint)
 Get the last impulse applied by this constraint.
 

Detailed Description

Function Documentation

CP_EXPORT void cpConstraintSetErrorBias ( cpConstraint constraint,
cpFloat  errorBias 
)

Set rate at which joint error is corrected.

Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.