iMSTK
Interactive Medical Simulation Toolkit
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
imstkRbdDistanceConstraint.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 {
21 {
22 public:
24  std::shared_ptr<RigidBody> obj1,
25  std::shared_ptr<RigidBody> obj2,
26  const Vec3d& p1, const Vec3d& p2,
27  double dist,
28  const Side side = Side::AB);
29  ~RbdDistanceConstraint() override = default;
30 
31  IMSTK_TYPE_NAME(RbdDistanceConstraint);
32 
33 public:
34  void compute(double dt) override;
35 
36 private:
37  Vec3d m_p1 = Vec3d(0.0, 0.0, 0.0);
38  Vec3d m_p2 = Vec3d(0.0, 0.0, 0.0);
39  double m_dist = 1.0;
40 };
41 } // namespace imstk
Abstract class for rigid body constraints. A RbdConstraint should mainly provide a constraint jacobia...
A rigid body constraint to keep objects at a specified distance from each other given two local point...
Compound Geometry.
void compute(double dt) override
Compute constraint jacobian.