iMSTK
Interactive Medical Simulation Toolkit
|
Surface collision disabled upon puncture. More...
#include <NeedlePbdCH.h>
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... | |
![]() | |
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) |
![]() | |
void | updateCollisionData (std::shared_ptr< const CollisionData > data) |
Additional Inherited Members | |
![]() | |
enum | ObjType { PbdDeformable, PbdRigid, Colliding } |
![]() | |
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 |
![]() | |
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< CollidingObject > | getInputObjectA () const |
Get the input objects. | |
std::shared_ptr< CollidingObject > | getInputObjectB () const |
virtual std::shared_ptr< Geometry > | getHandlingGeometryA () |
Get the geometry used for handling defaults to the collision geometry. | |
virtual std::shared_ptr< Geometry > | getHandlingGeometryB () |
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 CollisionData > | getInputCollisionData () const |
void | update () |
Handle the input collision data. | |
![]() | |
enum | ConstraintType { BodyBody = 0, BodyVertex, BodyEdge, BodyTriangle, VertexVertex, VertexEdge, EdgeEdge, VertexTriangle, EdgeEdgeCCD, NumTypes } |
![]() | |
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 |
![]() | |
std::shared_ptr< CollidingObject > | m_inputObjectA |
std::shared_ptr< CollidingObject > | m_inputObjectB |
std::shared_ptr< const CollisionData > | m_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 |
Surface collision disabled upon puncture.
Definition at line 21 of file NeedlePbdCH.h.
|
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.
CD | elements to resolve geomA |
CD | elements to resolve geomB |
Implements imstk::CollisionHandling.
Definition at line 30 of file NeedlePbdCH.h.