iMSTK
Interactive Medical Simulation Toolkit
imstkRbdFrictionConstraint.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkRbdConstraint.h"
10 #include "imstkMacros.h"
11 
12 namespace imstk
13 {
20 {
21 public:
23  std::shared_ptr<RigidBody> obj1,
24  std::shared_ptr<RigidBody> obj2,
25  const Vec3d& contactPt,
26  const Vec3d& contactNormal,
27  const double contactDepth,
28  const double frictionCoefficient,
29  const Side side = Side::AB);
30  ~RbdFrictionConstraint() override = default;
31 
32  IMSTK_TYPE_NAME(RbdFrictionConstraint);
33 
34 public:
35  void compute(double dt) override;
36 
37 private:
38  Vec3d m_contactPt;
39  Vec3d m_contactN;
40  double m_contactDepth;
41  double m_frictionCoefficient;
42 };
43 } // namespace imstk
A rigid body constraint to apply friction.
Abstract class for rigid body constraints. A RbdConstraint should mainly provide a constraint jacobia...
void compute(double dt) override
Compute constraint jacobian.
Compound Geometry.