9 #include "imstkCollisionHandling.h" 10 #include "imstkMacros.h" 12 #include <unordered_set> 18 class LevelSetDeformableObject;
36 void setInputLvlSetObj(std::shared_ptr<LevelSetDeformableObject> lvlSetObj);
37 void setInputRigidObj(std::shared_ptr<RigidObject2> rbdObj);
39 std::shared_ptr<LevelSetDeformableObject> getLvlSetObj();
40 std::shared_ptr<RigidObject2> getRigidObj();
46 void addPoint(
int id) { m_ptIdMask.insert(
id); }
62 void setLevelSetVelocityScaling(
const double velocityScaling) { m_velocityScaling = velocityScaling; }
69 bool getUseProportionalVelocity()
const {
return m_useProportionalForce; }
74 void setKernel(
const int size,
const double sigma = 1.0);
75 int getKernelSize()
const {
return m_kernelSize; }
76 double getKernelSigma()
const {
return m_kernelSigma; }
83 const std::vector<CollisionElement>& elementsA,
84 const std::vector<CollisionElement>& elementsB)
override;
87 std::unordered_set<int> m_ptIdMask;
88 double m_velocityScaling = 0.1;
89 bool m_useProportionalForce =
false;
91 double m_kernelSigma = 1.0;
92 double* m_kernelWeights =
nullptr;
double getLevelSetVelocityScaling() const
Set/Get Scale of the velocity used for the levelset, default 0.1.
Applies impulses to the leveset given point direction collision data propotional to the force on the ...
void maskAllPoints()
Allow all points to effect the levelset.
void handle(const std::vector< CollisionElement > &elementsA, const std::vector< CollisionElement > &elementsB) override
Compute forces and velocities based on collision data.
void setUseProportionalVelocity(const bool useProportionalForce)
Set/Get whether the velocity used on the levelset should be proportional to the force of the rigid bo...
void setKernel(const int size, const double sigma=1.0)
Set/Get the size + sigma of gaussian kernel used to apply impulse in levelset.
Base class for all collision handling classes.
void unmaskAllPoints()
Unmask all points.
void addPoint(int id)
Adds point to the mask allowing it to apply an impulse to the levelset.