iMSTK
Interactive Medical Simulation Toolkit
Protected Member Functions | List of all members
NeedlePbdCH Class Reference

Surface collision disabled upon puncture. More...

#include <NeedlePbdCH.h>

Inheritance diagram for NeedlePbdCH:
Inheritance graph
[legend]
Collaboration diagram for NeedlePbdCH:
Collaboration graph
[legend]

Protected Member Functions

void handle (const std::vector< CollisionElement > &elementsA, const std::vector< CollisionElement > &elementsB) override
 Handle the input collision data. Elements will be flipped (if needed) such that elementsA corresponds with inputObjectA and B with inputObjectB in the case CD is backwards from CH. More...
 
- Protected Member Functions inherited from imstk::PbdCollisionHandling
std::array< PbdParticleId, 2 > getEdge (const CollisionElement &elem, const CollisionSideData &side)
 
std::array< PbdParticleId, 3 > getTriangle (const CollisionElement &elem, const CollisionSideData &side)
 
std::array< PbdParticleId, 1 > getVertex (const CollisionElement &elem, const CollisionSideData &side)
 getVertex takes slightly differing paths than the others, as the cell vertex directly refers to the vertex buffer, not an index buffer
 
CollisionSideData getDataFromObject (std::shared_ptr< CollidingObject > obj)
 Creates a CollisionSideData struct from the provided object, this gives all the info needed to response to collision.
 
PbdContactCase getCaseFromElement (const ColElemSide &elem)
 Get the contact case from the collision element and data as additional context.
 
void handle (const std::vector< CollisionElement > &elementsA, const std::vector< CollisionElement > &elementsB) override
 Add collision constraints based off contact data.
 
void handleElementPair (ColElemSide sideA, ColElemSide sideB)
 Handle a single element.
 
virtual void addConstraint_Body_V (const ColElemSide &sideA, const ColElemSide &sideB)
 
virtual void addConstraint_Body_E (const ColElemSide &sideA, const ColElemSide &sideB)
 
virtual void addConstraint_Body_T (const ColElemSide &sideA, const ColElemSide &sideB)
 
virtual void addConstraint_Body_Body (const ColElemSide &sideA, const ColElemSide &sideB)
 
virtual void addConstraint_V_T (const ColElemSide &sideA, const ColElemSide &sideB)
 
virtual void addConstraint_E_E (const ColElemSide &sideA, const ColElemSide &sideB)
 
virtual void addConstraint_E_E_CCD (const ColElemSide &sideA, const ColElemSide &sideB)
 
virtual void addConstraint_V_E (const ColElemSide &sideA, const ColElemSide &sideB)
 
virtual void addConstraint_V_V (const ColElemSide &sideA, const ColElemSide &sideB)
 
template<class T >
T * getCachedConstraint (ConstraintType type)
 
- Protected Member Functions inherited from imstk::CollisionHandling
void updateCollisionData (std::shared_ptr< const CollisionData > data)
 

Additional Inherited Members

- Public Types inherited from imstk::PbdCollisionHandling
enum  ObjType { PbdDeformable, PbdRigid, Colliding }
 
- Public Member Functions inherited from imstk::PbdCollisionHandling
const std::vector< PbdConstraint * > & getConstraints () const
 Return the constraints generated by this handler This list of constraints is ordered in orderCollisionConstraints.
 
std::pair< PbdParticleId, Vec3d > getBodyAndContactPoint (const CollisionElement &elem, const CollisionSideData &data)
 Get the body particle id from the collision side as well as the contact point on the body (in global space)
 
double getRestitution () const
 Get/Set the restitution, which gives how much velocity is removed along the contact normals during contact.
 
void setRestitution (const double restitution)
 
double getFriction () const
 Get/Set the friction, which gives how much velocity is removed along the tangents during contact.
 
void setFriction (const double friction)
 
bool getUseCorrectVelocity () const
 Get/Set whether velocity is corrected (in some cases this could cause instabilities)
 
void setUseCorrectVelocity (const bool useCorrectVelocity)
 
int getCCDSubsteps () const
 Get/Set the number of substeps used in CCD constraints.
 
void setCCDSubsteps (const int ccdSubsteps)
 
void setEnableBoundaryCollisions (const bool enableBoundaryCollisions)
 Get enableBoundaryCollision.
 
const bool getEnableBoundaryCollisions () const
 
void setRigidBodyCompliance (const double compliance)
 Get/Set compliance of rigid body contacts. Defaults to 0 compliance/infinitely stiff. This is what is needed most of the time but sometimes making a contact a bit softer can be helpful.
 
double getRigidBodyCompliance () const
 
void setDeformableStiffnessA (const double stiffness)
 Get/Set stiffness of deformable contacts. Defaults to 1.0. This is what is needed most of the time but sometimes making a contact a bit softer can be helpful.
 
double getDeformableStiffnessA () const
 
void setDeformableStiffnessB (const double stiffness)
 
double getDeformableStiffnessB () const
 
- Public Member Functions inherited from imstk::CollisionHandling
virtual const std::string getTypeName () const =0
 
void setInputObjectA (std::shared_ptr< CollidingObject > objectA)
 Set the input objects.
 
void setInputObjectB (std::shared_ptr< CollidingObject > objectB)
 
std::shared_ptr< CollidingObjectgetInputObjectA () const
 Get the input objects.
 
std::shared_ptr< CollidingObjectgetInputObjectB () const
 
virtual std::shared_ptr< GeometrygetHandlingGeometryA ()
 Get the geometry used for handling defaults to the collision geometry.
 
virtual std::shared_ptr< GeometrygetHandlingGeometryB ()
 
void setInputCollisionData (std::shared_ptr< CollisionData > collisionData)
 Set/Get the input collision data used for handling.
 
void setInputCollisionData (std::shared_ptr< std::vector< std::shared_ptr< CollisionData >>> collisionVectorData)
 Set/Get the input collision data used for handling This supports collating information from multiple collision detect algorithms.
 
std::shared_ptr< const CollisionDatagetInputCollisionData () const
 
void update ()
 Handle the input collision data.
 
- Protected Types inherited from imstk::PbdCollisionHandling
enum  ConstraintType {
  BodyBody = 0, BodyVertex, BodyEdge, BodyTriangle,
  VertexVertex, VertexEdge, EdgeEdge, VertexTriangle,
  EdgeEdgeCCD, NumTypes
}
 
- Protected Attributes inherited from imstk::PbdCollisionHandling
std::vector< PbdConstraint * > m_constraintBins [NumTypes]
 
std::vector< PbdConstraint * > m_constraintCache [NumTypes]
 
std::vector< PbdConstraint * > m_collisionConstraints
 Vector of all collision constraints.
 
std::unordered_map< PbdCHTableKey, std::function< void(const ColElemSide &elemA, const ColElemSide &elemB)> > m_funcTable
 
- Protected Attributes inherited from imstk::CollisionHandling
std::shared_ptr< CollidingObjectm_inputObjectA
 
std::shared_ptr< CollidingObjectm_inputObjectB
 
std::shared_ptr< const CollisionDatam_colData
 Collision data.
 
std::shared_ptr< std::vector< std::shared_ptr< CollisionData > > > m_colVectorData
 Expansion to allow collision detection to return multiple types of collision data.
 
std::function< void()> m_updateFunction = []() {}
 
bool m_clearData = true
 
bool m_processConstraints = true
 

Detailed Description

Surface collision disabled upon puncture.

Definition at line 21 of file NeedlePbdCH.h.

Member Function Documentation

◆ handle()

void NeedlePbdCH::handle ( const std::vector< CollisionElement > &  elementsA,
const std::vector< CollisionElement > &  elementsB 
)
inlineoverrideprotectedvirtual

Handle the input collision data. Elements will be flipped (if needed) such that elementsA corresponds with inputObjectA and B with inputObjectB in the case CD is backwards from CH.

Parameters
CDelements to resolve geomA
CDelements to resolve geomB

Implements imstk::CollisionHandling.

Definition at line 30 of file NeedlePbdCH.h.

Here is the call graph for this function:

The documentation for this class was generated from the following file: