iMSTK
Interactive Medical Simulation Toolkit
NeedleRigidBodyCH.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 "imstkRigidBodyCH.h"
10 #include "imstkMacros.h"
11 
12 using namespace imstk;
13 
14 class NeedleRigidBodyCH : public RigidBodyCH
15 {
16 public:
17  NeedleRigidBodyCH() = default;
18  ~NeedleRigidBodyCH() override = default;
19 
20  IMSTK_TYPE_NAME(NeedleRigidBodyCH)
21 
22 protected:
26  virtual void handle(
27  const std::vector<CollisionElement>& elementsA,
28  const std::vector<CollisionElement>& elementsB) override;
29 
33  void addConstraint(
34  std::shared_ptr<RigidObject2> rbdObj,
35  const Vec3d& contactPt, const Vec3d& contactNormal,
36  const double contactDepth) override;
37 
38 protected:
39  Vec3d m_initContactPt = Vec3d::Zero();
40  Vec3d m_initNeedleAxes = Vec3d::Zero();
41  Quatd m_initNeedleOrientation = Quatd::Identity();
42 };
Compound Geometry.
Creates rigid body contact and frictional constraints given collision data then adds them to the rigi...