Skip to content

Commit

Permalink
ContactConstraint: read friction from ShapeNode
Browse files Browse the repository at this point in the history
  • Loading branch information
scpeters committed Jul 10, 2019
1 parent dbdcdec commit f8b5378
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dart/constraint/ContactConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,15 @@ ContactConstraint::ContactConstraint(
// TODO(JS): Assume the frictional coefficient can be changed during
// simulation steps.
// Update mFrictionalCoff
auto shapeNodeA(const_cast<dynamics::ShapeFrame*>(
contact.collisionObject1->getShapeFrame())
->asShapeNode());
auto shapeNodeB(const_cast<dynamics::ShapeFrame*>(
contact.collisionObject2->getShapeFrame())
->asShapeNode());
mFrictionCoeff = std::min(
mBodyNodeA->getFrictionCoeff(), mBodyNodeB->getFrictionCoeff());
shapeNodeA->getDynamicsAspect()->getFrictionCoeff(),
shapeNodeB->getDynamicsAspect()->getFrictionCoeff());
if (mFrictionCoeff > DART_FRICTION_COEFF_THRESHOLD)
{
mIsFrictionOn = true;
Expand Down

0 comments on commit f8b5378

Please sign in to comment.