9 #include "imstkPbdConstraint.h" 29 const Vec3d& p0,
const Vec3d& p1,
const Vec3d& p2,
const Vec3d& p3,
32 const double k = 2.0);
41 double& c, std::vector<Vec3d>& dcdx)
override;
void initConstraint(const Vec3d &p0, const Vec3d &p1, const Vec3d &p2, const Vec3d &p3, const PbdParticleId &pIdx0, const PbdParticleId &pIdx1, const PbdParticleId &pIdx2, const PbdParticleId &pIdx3, const double k=2.0)
Initializes the volume constraint.
std::pair< int, int > PbdParticleId
Index pair that refers to a particle in a PbdState. Index 0 is the body id, Index 1 is the particle i...
double m_restVolume
Rest volume.
bool computeValueAndGradient(PbdState &bodies, double &c, std::vector< Vec3d > &dcdx) override
Compute value and gradient of constraint function.
double getRestValue() const
Return the rest configuration for the constraint.
Base Constraint class for Position based dynamics constraints.
Provides interface for accessing particles from a 2d array of PbdBody,Particles.
Volume constraint for tetrahedral element.