iMSTK
Interactive Medical Simulation Toolkit
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
imstk::RigidBodyCH Class Reference

Creates rigid body contact and frictional constraints given collision data then adds them to the rigid body model, if rigid objects use differing models, one-way contacts are added to both. If only one rigid object is given, one-ways are used. More...

#include <imstkRigidBodyCH.h>

Inheritance diagram for imstk::RigidBodyCH:
Inheritance graph
[legend]
Collaboration diagram for imstk::RigidBodyCH:
Collaboration graph
[legend]

Public Member Functions

void setInputRigidObjectA (std::shared_ptr< RigidObject2 > rbdObjA)
 
void setInputRigidObjectB (std::shared_ptr< RigidObject2 > rbdObjB)
 Second input rigid object is optional.
 
void setInputCollidingObjectB (std::shared_ptr< CollidingObject > colObjB)
 Second input colliding object is optional.
 
std::shared_ptr< RigidObject2getRigidObjA ()
 
std::shared_ptr< RigidObject2getRigidObjB ()
 
void setBaumgarteStabilization (double beta)
 Baumgarte stabilization term, scales the constraint scalars The higher it is, the faster constraint violations are dealt with (bigger steps), but could introduce erroneous velocity.
 
const double getBeta () const
 
void setFriction (double frictionalCoefficient)
 
const double getFriction () const
 
void setUseFriction (bool useFriction)
 
const double getUseFriction () 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 Member Functions

virtual void handle (const std::vector< CollisionElement > &elementsA, const std::vector< CollisionElement > &elementsB) override
 Add rigid body constraints according to contacts.
 
void handleRbdRbdTwoWay (std::shared_ptr< RigidObject2 > rbdObjA, std::shared_ptr< RigidObject2 > rbdObjB, const std::vector< CollisionElement > &elementsA, const std::vector< CollisionElement > &elementsB)
 Handle rigid vs rigid two-way edge-edge, vertex-triangle, etc.
 
void handleRbdStaticOneWay (std::shared_ptr< RigidObject2 > rbdObj, std::shared_ptr< CollidingObject > colObj, const std::vector< CollisionElement > &elementsA, const std::vector< CollisionElement > &elementsB)
 Handle rigid vs static one-way edge-edge, vertex-triangle, etc.
 
virtual void addConstraint (std::shared_ptr< RigidObject2 > rbdObj, const Vec3d &contactPt, const Vec3d &contactNormal, const double contactDepth)
 Add constraint for the rigid body given contact.
 
virtual void addConstraint (std::shared_ptr< RigidObject2 > rbdObjA, std::shared_ptr< RigidObject2 > rbdObjB, const Vec3d &contactPt, const Vec3d &contactNormal, const double contactDepth)
 Add two-way constraint for the rigid bodies given contact.
 
- Protected Member Functions inherited from imstk::CollisionHandling
void updateCollisionData (std::shared_ptr< const CollisionData > data)
 

Protected Attributes

double m_beta = 0.0
 
double m_frictionalCoefficient = 2.0
 
bool m_useFriction = false
 
- 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

Creates rigid body contact and frictional constraints given collision data then adds them to the rigid body model, if rigid objects use differing models, one-way contacts are added to both. If only one rigid object is given, one-ways are used.

Definition at line 27 of file imstkRigidBodyCH.h.


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