MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / initialize

Method initialize

src/systems/ConstraintSolverSystem.cpp:60–91  ·  view source on GitHub ↗

Initialize the constraint solver

Source from the content-addressed store, hash-verified

58
59// Initialize the constraint solver
60void ConstraintSolverSystem::initialize(decimal dt) {
61
62 RP3D_PROFILE("ConstraintSolverSystem::initialize()", mProfiler);
63
64 // Set the current time step
65 mTimeStep = dt;
66
67 // Initialize the constraint solver data used to initialize and solve the constraints
68 mConstraintSolverData.timeStep = mTimeStep;
69 mConstraintSolverData.isWarmStartingActive = mIsWarmStartingActive;
70
71 mSolveBallAndSocketJointSystem.setTimeStep(dt);
72 mSolveBallAndSocketJointSystem.setIsWarmStartingActive(mIsWarmStartingActive);
73 mSolveFixedJointSystem.setTimeStep(dt);
74 mSolveFixedJointSystem.setIsWarmStartingActive(mIsWarmStartingActive);
75 mSolveHingeJointSystem.setTimeStep(dt);
76 mSolveHingeJointSystem.setIsWarmStartingActive(mIsWarmStartingActive);
77 mSolveSliderJointSystem.setTimeStep(dt);
78 mSolveSliderJointSystem.setIsWarmStartingActive(mIsWarmStartingActive);
79
80 mSolveBallAndSocketJointSystem.initBeforeSolve();
81 mSolveFixedJointSystem.initBeforeSolve();
82 mSolveHingeJointSystem.initBeforeSolve();
83 mSolveSliderJointSystem.initBeforeSolve();
84
85 if (mIsWarmStartingActive) {
86 mSolveBallAndSocketJointSystem.warmstart();
87 mSolveFixedJointSystem.warmstart();
88 mSolveHingeJointSystem.warmstart();
89 mSolveSliderJointSystem.warmstart();
90 }
91}
92
93// Solve the velocity constraints
94void ConstraintSolverSystem::solveVelocityConstraints() {

Callers 2

initMethod · 0.80

Calls 4

setTimeStepMethod · 0.45
initBeforeSolveMethod · 0.45
warmstartMethod · 0.45

Tested by

no test coverage detected