7 #include "imstkPbdPointPointConstraint.h" 14 double stiffnessA,
double stiffnessB)
19 m_stiffness[0] = stiffnessA;
20 m_stiffness[1] = stiffnessB;
25 double& c, std::vector<Vec3d>& dcdx)
28 const Vec3d& x0 = bodies.getPosition(
m_particles[0]);
29 const Vec3d& x1 = bodies.getPosition(
m_particles[1]);
31 const Vec3d diff = x1 - x0;
39 const Vec3d n = diff / c;
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...
bool computeValueAndGradient(PbdState &bodies, double &c, std::vector< Vec3d > &dcdx) override
Compute value and gradient of constraint function.
std::vector< PbdParticleId > m_particles
body, particle index
Provides interface for accessing particles from a 2d array of PbdBody,Particles.
void initConstraint(const PbdParticleId &ptA, const PbdParticleId &ptB, double stiffnessA, double stiffnessB)
Initialize constraint.