A constraint manager manages all constraints of the same type.
More...
#include <ConstraintManager.h>
|
static void | sBuildIslands (Constraint **inActiveConstraints, uint32 inNumActiveConstraints, IslandBuilder &ioBuilder, BodyManager &inBodyManager) |
| Link bodies to form islands.
|
|
static void | sSortConstraints (Constraint **inActiveConstraints, uint32 *inConstraintIdxBegin, uint32 *inConstraintIdxEnd) |
| In order to have a deterministic simulation, we need to sort the constraints of an island before solving them.
|
|
static void | sSetupVelocityConstraints (Constraint **inActiveConstraints, uint32 inNumActiveConstraints, float inDeltaTime) |
| Prior to solving the velocity constraints, you must call SetupVelocityConstraints once to precalculate values that are independent of velocity.
|
|
static void | sWarmStartVelocityConstraints (Constraint **inActiveConstraints, const uint32 *inConstraintIdxBegin, const uint32 *inConstraintIdxEnd, float inWarmStartImpulseRatio) |
| Apply last frame's impulses, must be called prior to SolveVelocityConstraints.
|
|
static void | sWarmStartVelocityConstraints (Constraint **inActiveConstraints, const uint32 *inConstraintIdxBegin, const uint32 *inConstraintIdxEnd, float inWarmStartImpulseRatio, int &ioNumVelocitySteps) |
| Same as above but also calculates the number of velocity steps.
|
|
static bool | sSolveVelocityConstraints (Constraint **inActiveConstraints, const uint32 *inConstraintIdxBegin, const uint32 *inConstraintIdxEnd, float inDeltaTime) |
| This function is called multiple times to iteratively come to a solution that meets all velocity constraints.
|
|
static bool | sSolvePositionConstraints (Constraint **inActiveConstraints, const uint32 *inConstraintIdxBegin, const uint32 *inConstraintIdxEnd, float inDeltaTime, float inBaumgarte) |
| This function is called multiple times to iteratively come to a solution that meets all position constraints.
|
|
static bool | sSolvePositionConstraints (Constraint **inActiveConstraints, const uint32 *inConstraintIdxBegin, const uint32 *inConstraintIdxEnd, float inDeltaTime, float inBaumgarte, int &ioNumPositionSteps) |
| Same as above but also calculates the number of position steps.
|
|
A constraint manager manages all constraints of the same type.
◆ Add()
Add a new constraint. This is thread safe. Note that the inConstraints array is allowed to have nullptrs, these will be ignored.
◆ DrawConstraintLimits()
void ConstraintManager::DrawConstraintLimits |
( |
DebugRenderer * | inRenderer | ) |
const |
Draw all constraint limits.
◆ DrawConstraintReferenceFrame()
void ConstraintManager::DrawConstraintReferenceFrame |
( |
DebugRenderer * | inRenderer | ) |
const |
Draw all constraint reference frames.
◆ DrawConstraints()
void ConstraintManager::DrawConstraints |
( |
DebugRenderer * | inRenderer | ) |
const |
◆ GetActiveConstraints()
void ConstraintManager::GetActiveConstraints |
( |
uint32 | inStartConstraintIdx, |
|
|
uint32 | inEndConstraintIdx, |
|
|
Constraint ** | outActiveConstraints, |
|
|
uint32 & | outNumActiveConstraints ) const |
Determine the active constraints of a subset of the constraints.
◆ GetConstraints()
Constraints ConstraintManager::GetConstraints |
( |
| ) |
const |
Get a list of all constraints.
◆ GetNumConstraints()
uint32 ConstraintManager::GetNumConstraints |
( |
| ) |
const |
|
inline |
Get total number of constraints.
◆ LockAllConstraints()
void ConstraintManager::LockAllConstraints |
( |
| ) |
|
|
inline |
◆ Remove()
void ConstraintManager::Remove |
( |
Constraint ** | inConstraint, |
|
|
int | inNumber ) |
Remove a constraint. This is thread safe. Note that the inConstraints array is allowed to have nullptrs, these will be ignored.
◆ RestoreState()
Restore the state of constraints. Returns false if failed.
◆ SaveState()
Save state of constraints.
◆ sBuildIslands()
Link bodies to form islands.
◆ sSetupVelocityConstraints()
void ConstraintManager::sSetupVelocityConstraints |
( |
Constraint ** | inActiveConstraints, |
|
|
uint32 | inNumActiveConstraints, |
|
|
float | inDeltaTime ) |
|
static |
Prior to solving the velocity constraints, you must call SetupVelocityConstraints once to precalculate values that are independent of velocity.
◆ sSolvePositionConstraints() [1/2]
bool ConstraintManager::sSolvePositionConstraints |
( |
Constraint ** | inActiveConstraints, |
|
|
const uint32 * | inConstraintIdxBegin, |
|
|
const uint32 * | inConstraintIdxEnd, |
|
|
float | inDeltaTime, |
|
|
float | inBaumgarte ) |
|
static |
This function is called multiple times to iteratively come to a solution that meets all position constraints.
◆ sSolvePositionConstraints() [2/2]
bool ConstraintManager::sSolvePositionConstraints |
( |
Constraint ** | inActiveConstraints, |
|
|
const uint32 * | inConstraintIdxBegin, |
|
|
const uint32 * | inConstraintIdxEnd, |
|
|
float | inDeltaTime, |
|
|
float | inBaumgarte, |
|
|
int & | ioNumPositionSteps ) |
|
static |
Same as above but also calculates the number of position steps.
◆ sSolveVelocityConstraints()
bool ConstraintManager::sSolveVelocityConstraints |
( |
Constraint ** | inActiveConstraints, |
|
|
const uint32 * | inConstraintIdxBegin, |
|
|
const uint32 * | inConstraintIdxEnd, |
|
|
float | inDeltaTime ) |
|
static |
This function is called multiple times to iteratively come to a solution that meets all velocity constraints.
◆ sSortConstraints()
void ConstraintManager::sSortConstraints |
( |
Constraint ** | inActiveConstraints, |
|
|
uint32 * | inConstraintIdxBegin, |
|
|
uint32 * | inConstraintIdxEnd ) |
|
static |
In order to have a deterministic simulation, we need to sort the constraints of an island before solving them.
◆ sWarmStartVelocityConstraints() [1/2]
void ConstraintManager::sWarmStartVelocityConstraints |
( |
Constraint ** | inActiveConstraints, |
|
|
const uint32 * | inConstraintIdxBegin, |
|
|
const uint32 * | inConstraintIdxEnd, |
|
|
float | inWarmStartImpulseRatio ) |
|
static |
Apply last frame's impulses, must be called prior to SolveVelocityConstraints.
◆ sWarmStartVelocityConstraints() [2/2]
void ConstraintManager::sWarmStartVelocityConstraints |
( |
Constraint ** | inActiveConstraints, |
|
|
const uint32 * | inConstraintIdxBegin, |
|
|
const uint32 * | inConstraintIdxEnd, |
|
|
float | inWarmStartImpulseRatio, |
|
|
int & | ioNumVelocitySteps ) |
|
static |
Same as above but also calculates the number of velocity steps.
◆ UnlockAllConstraints()
void ConstraintManager::UnlockAllConstraints |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following files: