iMSTK
Interactive Medical Simulation Toolkit
|
Represents a pbd body in the model. This is a data only object. It does no function. PbdBody can be of different types. The types effect what properties it has. More...
#include <imstkPbdBody.h>
Public Types | |
enum | Type { DEFORMABLE, DEFORMABLE_ORIENTED, RIGID } |
Public Member Functions | |
PbdBody (const int handle) | |
void | deepCopy (const PbdBody &src) |
Deep copy from src, copying dynamic allocations by value. | |
bool | getOriented () const |
The body should have orientations if its DEFORMABLE_ORIENTED or RIGID. | |
void | setRigid (const Vec3d &pos, const double mass=1.0, const Quatd &orientation=Quatd::Identity(), const Mat3d &inertia=Mat3d::Identity()) |
void | setRigidVelocity (const Vec3d &velocity, const Vec3d &angularVelocity=Vec3d::Zero()) |
Vec3d | getRigidPosition () |
Quatd | getRigidOrientation () |
void | overrideRigidPositionAndOrientation (const Vec3d &pos, const Quatd &orientation) |
Override the current position and orientation this can be used to handle pauses, switching of tools or other action that need to transform the body without running through the physics. Can only be used on Rigid bodies. | |
void | overrideLinearAndAngularVelocity (const Vec3d &velocity, const Vec3d &angularVelocity) |
Override the current linear and angular velocity this can be used to handle pauses, switching of tools or other action that need to transform the body without running through the physics. Can only be used on Rigid bodies. | |
Public Attributes | |
int | bodyHandle |
Id in the system. | |
Type | bodyType = Type::DEFORMABLE |
std::shared_ptr< VecDataArray< double, 3 > > | prevVertices |
std::shared_ptr< VecDataArray< double, 3 > > | vertices |
std::shared_ptr< VecDataArray< double, 3 > > | velocities |
std::shared_ptr< DataArray< double > > | masses |
std::shared_ptr< DataArray< double > > | invMasses |
std::shared_ptr< StdVectorOfQuatd > | prevOrientations |
std::shared_ptr< StdVectorOfQuatd > | orientations |
std::shared_ptr< VecDataArray< double, 3 > > | angularVelocities |
std::shared_ptr< StdVectorOfMat3d > | inertias |
std::shared_ptr< StdVectorOfMat3d > | invInertias |
std::vector< int > | fixedNodeIds |
Nodal/vertex IDs of the nodes that are fixed. | |
double | uniformMassValue = 1.0 |
Mass properties, not used if per vertex masses are given in geometry attributes. | |
bool | bodyGravity = true |
Switch to activate/deactivate gravity for this Pbd Body. 1 is gravity on, 0 is gravity off. | |
Vec3d | externalForce = Vec3d::Zero() |
Vec3d | externalTorque = Vec3d::Zero() |
std::unordered_map< int, double > | fixedNodeInvMass |
Map for archiving fixed nodes' mass. | |
std::unordered_map< int, std::vector< std::shared_ptr< PbdConstraint > > > | cellConstraintMap |
Represents a pbd body in the model. This is a data only object. It does no function. PbdBody can be of different types. The types effect what properties it has.
A deformable PbdBody only uses vertices, velocities, & masses. A deformable oriented body uses all properties, adding orientations, angular velocities, and inertias. A rigid uses all properties but contains only one particle to represent the rigid body.
These may all be used together in constraints allowing things like distance constraints to not only function on an edge in a deformable mesh but also between two rigid bodies or even between two totally separate deformable meshes.
Definition at line 53 of file imstkPbdBody.h.
std::unordered_map<int, std::vector<std::shared_ptr<PbdConstraint> > > imstk::PbdBody::cellConstraintMap |
Map for storing the constraints associated with a given cell useful for speeding up cell removal based on cell state
Definition at line 221 of file imstkPbdBody.h.