@@ -76,7 +76,7 @@ void MORUnilateralInteractionConstraint<DataTypes>::buildConstraintMatrix(const
76
76
c1_it.addCol (c.m1 , -c.norm );
77
77
c1_it.addCol (c.m2 , c.norm );
78
78
79
- if (c.mu > 0.0 )
79
+ if (c.parameters . hasTangentialComponent () )
80
80
{
81
81
c1_it = c1.writeLine (c.id + 1 );
82
82
c1_it.setCol (c.m1 , -c.t );
@@ -108,16 +108,16 @@ void MORUnilateralInteractionConstraint<DataTypes>::buildConstraintMatrix(const
108
108
for (unsigned int i = 0 ; i < contacts.size (); i++)
109
109
{
110
110
auto & c = contacts[i];
111
- myMuForAllContacts = c.mu ;
111
+ myMuForAllContacts = c.parameters . mu ;
112
112
c.id = i;
113
- if (c. mu == 0.0 )
113
+ if (!c. parameters . hasTangentialComponent () )
114
114
if (contactIndices (c.m2 ) != -1 && lambdaModes (contactIndices (c.m2 ),numMode)!=0.0 ){
115
115
c1_it.addCol (c.m1 , -lambdaModes (contactIndices (c.m2 ),numMode)*c.norm );
116
116
c2_it.addCol (c.m2 , lambdaModes (contactIndices (c.m2 ),numMode)*c.norm );
117
117
somethingAdded = true ;
118
118
}
119
119
120
- if (c.mu > 0.0 )
120
+ if (c.parameters . hasTangentialComponent () )
121
121
{
122
122
if (contactIndices (3 *c.m2 ) != -1 && lambdaModes (contactIndices (3 *c.m2 ),numMode)!=0.0 ){
123
123
c1_it.addCol (c.m1 , -lambdaModes (contactIndices (3 *c.m2 ),numMode)*c.norm );
@@ -176,27 +176,6 @@ void MORUnilateralInteractionConstraint<DataTypes>::buildConstraintMatrix(const
176
176
// contactId = contactId - 3;
177
177
}
178
178
179
- template <class DataTypes >
180
- void MORUnilateralInteractionConstraint<DataTypes>::getConstraintViolation(const core::ConstraintParams *cparams, linearalgebra::BaseVector *v, const DataVecCoord &, const DataVecCoord &
181
- , const DataVecDeriv &, const DataVecDeriv &)
182
- {
183
- switch (cparams->constOrder ())
184
- {
185
- case core::ConstraintParams::POS_AND_VEL :
186
- case core::ConstraintParams::POS :
187
- getPositionViolation (v);
188
- break ;
189
-
190
- case core::ConstraintParams::ACC :
191
- case core::ConstraintParams::VEL :
192
- UnilateralLagrangianConstraint<DataTypes>::getVelocityViolation (v);
193
- break ;
194
-
195
- default :
196
- msg_error () << this ->getClassName () << " doesn't implement " << cparams->getName () << " constraint violation" ;
197
- break ;
198
- }
199
- }
200
179
201
180
template <class DataTypes >
202
181
void MORUnilateralInteractionConstraint<DataTypes>::getPositionViolation(linearalgebra::BaseVector *v)
@@ -265,7 +244,7 @@ void MORUnilateralInteractionConstraint<DataTypes>::getPositionViolation(lineara
265
244
}
266
245
267
246
// Sets dfree in global violation vector
268
- if (c. mu == 0.0 ){
247
+ if (!c. parameters . hasTangentialComponent () ){
269
248
270
249
for (int k=0 ;k<reducedContacts.size ();k++){
271
250
if (contactIndices (c.m2 ) != -1 )
@@ -312,10 +291,10 @@ void MORUnilateralInteractionConstraint<DataTypes>::getConstraintResolution(cons
312
291
for (unsigned int i=0 ; i<reducedContacts.size (); i++)
313
292
{
314
293
auto & c = contacts[0 ];
315
- if (c.mu > 0.0 )
294
+ if (c.parameters . hasTangentialComponent () )
316
295
{
317
296
i = i+2 ;
318
- UnilateralConstraintResolutionWithFriction* ucrwf = new UnilateralConstraintResolutionWithFriction (c.mu , nullptr , &contactsStatus[i]);
297
+ UnilateralConstraintResolutionWithFriction* ucrwf = new UnilateralConstraintResolutionWithFriction (c.parameters . mu , nullptr , &contactsStatus[i]);
319
298
ucrwf->setTolerance (customTolerance);
320
299
resTab[offset] = ucrwf;
321
300
// TODO : cette méthode de stockage des forces peu mal fonctionner avec 2 threads quand on utilise l'haptique
0 commit comments