9 #include "imstkPbdConstraint.h" 10 #include "imstkSolverBase.h" 14 class PbdConstraintContainer;
32 void setIterations(
const size_t iterations) { this->m_iterations = iterations; }
38 void setConstraints(std::shared_ptr<PbdConstraintContainer> constraints) { this->m_constraints = constraints; }
46 m_constraintLists->push_back(constraints);
72 void solve()
override;
77 const std::list<std::vector<PbdConstraint*>*>&
getConstraintLists()
const {
return *m_constraintLists; }
85 size_t m_iterations = 20;
88 std::shared_ptr<PbdConstraintContainer> m_constraints =
nullptr;
91 std::shared_ptr<std::list<std::vector<PbdConstraint*>*>> m_constraintLists =
nullptr;
void solve() override
Solve the non linear system of equations G(x)=0 using Newton's method.
const std::list< std::vector< PbdConstraint * > * > & getConstraintLists() const
Get all the collision constraints, read only.
void clearConstraintLists()
Clear all collision constraints.
void setSolverType(const PbdConstraint::SolverType &type)
Set the PBD solver type.
void addConstraints(std::vector< PbdConstraint *> *constraints)
Add a constraint list to this solver to be solved, for quick addition/removal particularly collision...
void setTimeStep(const double dt)
Set time step.
void setConstraints(std::shared_ptr< PbdConstraintContainer > constraints)
Sets the constraints the solver should solve for These wil be solved sequentially.
size_t getIterations() const
Get Iterations. Returns current nonlinear iterations.
void setPbdBodies(PbdState *state)
Sets the bodies to solve with.
SolverType
Type of solvers.
Position Based Dynamics solver This solver can solve both partitioned constraints (unordered_set of v...
Provides interface for accessing particles from a 2d array of PbdBody,Particles.
void setIterations(const size_t iterations)
Set Iterations. The number of nonlinear iterations.