Class SimulationModel
Defined in File SimulationModel.h
Class Documentation
-
class SimulationModel : public GenParam::ParameterObject
Public Types
-
typedef std::vector<Constraint*> ConstraintVector
-
typedef std::vector<RigidBodyContactConstraint> RigidBodyContactConstraintVector
-
typedef std::vector<ParticleRigidBodyContactConstraint> ParticleRigidBodyContactConstraintVector
-
typedef std::vector<ParticleTetContactConstraint> ParticleSolidContactConstraintVector
-
typedef std::vector<TriangleModel*> TriangleModelVector
-
typedef std::vector<unsigned int> ConstraintGroup
-
typedef std::vector<ConstraintGroup> ConstraintGroupVector
Public Functions
-
SimulationModel()
-
SimulationModel(const SimulationModel&) = delete
-
SimulationModel &operator=(const SimulationModel&) = delete
-
virtual ~SimulationModel()
-
void init()
-
virtual void initParameters()
-
virtual void reset()
-
virtual void cleanup()
-
RigidBodyVector &getRigidBodies()
-
ParticleData &getParticles()
-
OrientationData &getOrientations()
-
TriangleModelVector &getTriangleModels()
-
TetModelVector &getTetModels()
-
LineModelVector &getLineModels()
-
ConstraintVector &getConstraints()
-
RigidBodyContactConstraintVector &getRigidBodyContactConstraints()
-
ParticleRigidBodyContactConstraintVector &getParticleRigidBodyContactConstraints()
-
ParticleSolidContactConstraintVector &getParticleSolidContactConstraints()
-
ConstraintGroupVector &getConstraintGroups()
-
void resetContacts()
-
void addTriangleModel(const unsigned int nPoints, const unsigned int nFaces, Vector3r *points, unsigned int *indices, const TriangleModel::ParticleMesh::UVIndices &uvIndices, const TriangleModel::ParticleMesh::UVs &uvs)
-
void addRegularTriangleModel(const int width, const int height, const Vector3r &translation = Vector3r::Zero(), const Matrix3r &rotation = Matrix3r::Identity(), const Vector2r &scale = Vector2r::Ones())
-
void addTetModel(const unsigned int nPoints, const unsigned int nTets, Vector3r *points, unsigned int *indices)
-
void addRegularTetModel(const int width, const int height, const int depth, const Vector3r &translation = Vector3r::Zero(), const Matrix3r &rotation = Matrix3r::Identity(), const Vector3r &scale = Vector3r::Ones())
-
void addLineModel(const unsigned int nPoints, const unsigned int nQuaternions, Vector3r *points, Quaternionr *quaternions, unsigned int *indices, unsigned int *indicesQuaternions)
-
void updateConstraints()
-
void initConstraintGroups()
-
bool addBallJoint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &pos)
-
bool addBallOnLineJoint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &pos, const Vector3r &dir)
-
bool addHingeJoint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &pos, const Vector3r &axis)
-
bool addTargetAngleMotorHingeJoint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &pos, const Vector3r &axis)
-
bool addTargetVelocityMotorHingeJoint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &pos, const Vector3r &axis)
-
bool addUniversalJoint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &pos, const Vector3r &axis1, const Vector3r &axis2)
-
bool addSliderJoint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &axis)
-
bool addTargetPositionMotorSliderJoint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &axis)
-
bool addTargetVelocityMotorSliderJoint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &axis)
-
bool addRigidBodyParticleBallJoint(const unsigned int rbIndex, const unsigned int particleIndex)
-
bool addRigidBodySpring(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &pos1, const Vector3r &pos2, const Real stiffness)
-
bool addDistanceJoint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &pos1, const Vector3r &pos2)
-
bool addDamperJoint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &axis, const Real stiffness)
-
bool addRigidBodyContactConstraint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &cp1, const Vector3r &cp2, const Vector3r &normal, const Real dist, const Real restitutionCoeff, const Real frictionCoeff)
-
bool addParticleRigidBodyContactConstraint(const unsigned int particleIndex, const unsigned int rbIndex, const Vector3r &cp1, const Vector3r &cp2, const Vector3r &normal, const Real dist, const Real restitutionCoeff, const Real frictionCoeff)
-
bool addParticleSolidContactConstraint(const unsigned int particleIndex, const unsigned int solidIndex, const unsigned int tetIndex, const Vector3r &bary, const Vector3r &cp1, const Vector3r &cp2, const Vector3r &normal, const Real dist, const Real restitutionCoeff, const Real frictionCoeff)
-
bool addDistanceConstraint(const unsigned int particle1, const unsigned int particle2, const Real stiffness)
-
bool addDistanceConstraint_XPBD(const unsigned int particle1, const unsigned int particle2, const Real stiffness)
-
bool addDihedralConstraint(const unsigned int particle1, const unsigned int particle2, const unsigned int particle3, const unsigned int particle4, const Real stiffness)
-
bool addIsometricBendingConstraint(const unsigned int particle1, const unsigned int particle2, const unsigned int particle3, const unsigned int particle4, const Real stiffness)
-
bool addIsometricBendingConstraint_XPBD(const unsigned int particle1, const unsigned int particle2, const unsigned int particle3, const unsigned int particle4, const Real stiffness)
-
bool addFEMTriangleConstraint(const unsigned int particle1, const unsigned int particle2, const unsigned int particle3, const Real xxStiffness, const Real yyStiffness, const Real xyStiffness, const Real xyPoissonRatio, const Real yxPoissonRatio)
-
bool addStrainTriangleConstraint(const unsigned int particle1, const unsigned int particle2, const unsigned int particle3, const Real xxStiffness, const Real yyStiffness, const Real xyStiffness, const bool normalizeStretch, const bool normalizeShear)
-
bool addVolumeConstraint(const unsigned int particle1, const unsigned int particle2, const unsigned int particle3, const unsigned int particle4, const Real stiffness)
-
bool addVolumeConstraint_XPBD(const unsigned int particle1, const unsigned int particle2, const unsigned int particle3, const unsigned int particle4, const Real stiffness)
-
bool addFEMTetConstraint(const unsigned int particle1, const unsigned int particle2, const unsigned int particle3, const unsigned int particle4, const Real stiffness, const Real poissonRatio)
-
bool addFEMTetConstraint_XPBD(const unsigned int particle1, const unsigned int particle2, const unsigned int particle3, const unsigned int particle4, const Real stiffness, const Real poissonRatio)
-
bool addStrainTetConstraint(const unsigned int particle1, const unsigned int particle2, const unsigned int particle3, const unsigned int particle4, const Real stretchStiffness, const Real shearStiffness, const bool normalizeStretch, const bool normalizeShear)
-
bool addShapeMatchingConstraint(const unsigned int numberOfParticles, const unsigned int particleIndices[], const unsigned int numClusters[], const Real stiffness)
-
bool addStretchShearConstraint(const unsigned int particle1, const unsigned int particle2, const unsigned int quaternion1, const Real stretchingStiffness, const Real shearingStiffness1, const Real shearingStiffness2)
-
bool addBendTwistConstraint(const unsigned int quaternion1, const unsigned int quaternion2, const Real twistingStiffness, const Real bendingStiffness1, const Real bendingStiffness2)
-
bool addStretchBendingTwistingConstraint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &pos, const Real averageRadius, const Real averageSegmentLength, const Real youngsModulus, const Real torsionModulus)
-
bool addDirectPositionBasedSolverForStiffRodsConstraint(const std::vector<std::pair<unsigned int, unsigned int>> &jointSegmentIndices, const std::vector<Vector3r> &jointPositions, const std::vector<Real> &averageRadii, const std::vector<Real> &averageSegmentLengths, const std::vector<Real> &youngsModuli, const std::vector<Real> &torsionModuli)
-
inline Real getContactStiffnessRigidBody() const
-
inline void setContactStiffnessRigidBody(Real val)
-
inline Real getContactStiffnessParticleRigidBody() const
-
inline void setContactStiffnessParticleRigidBody(Real val)
-
void addClothConstraints(const TriangleModel *tm, const unsigned int clothMethod, const Real distanceStiffness, const Real xxStiffness, const Real yyStiffness, const Real xyStiffness, const Real xyPoissonRatio, const Real yxPoissonRatio, const bool normalizeStretch, const bool normalizeShear)
-
void addBendingConstraints(const TriangleModel *tm, const unsigned int bendingMethod, const Real stiffness)
-
void addSolidConstraints(const TetModel *tm, const unsigned int solidMethod, const Real stiffness, const Real poissonRatio, const Real volumeStiffness, const bool normalizeStretch, const bool normalizeShear)
-
template<typename ConstraintType, typename T, T ConstraintType::* MemPtr>
inline void setConstraintValue(const T v)
-
inline void setClothSimulationMethodChangedCallback(std::function<void()> const &callBackFct)
-
inline void setClothBendingMethodChangedCallback(std::function<void()> const &callBackFct)
-
inline void setSolidSimulationMethodChangedCallback(std::function<void()> const &callBackFct)
-
inline virtual int getClothSimulationMethod()
-
virtual void setClothSimulationMethod(const int val)
-
inline virtual int getClothBendingMethod()
-
virtual void setClothBendingMethod(const int val)
-
inline virtual Real getClothStiffness()
-
virtual void setClothStiffness(Real val)
-
inline virtual Real getClothStiffnessXX()
-
virtual void setClothStiffnessXX(Real val)
-
inline virtual Real getClothStiffnessYY()
-
virtual void setClothStiffnessYY(Real val)
-
inline virtual Real getClothStiffnessXY()
-
virtual void setClothStiffnessXY(Real val)
-
inline virtual Real getClothPoissonRatioXY()
-
virtual void setClothPoissonRatioXY(Real val)
-
inline virtual Real getClothPoissonRatioYX()
-
virtual void setClothPoissonRatioYX(Real val)
-
inline virtual Real getClothBendingStiffness()
-
virtual void setClothBendingStiffness(Real val)
-
inline virtual bool getClothNormalizeStretch()
-
virtual void setClothNormalizeStretch(bool val)
-
inline virtual bool getClothNormalizeShear()
-
virtual void setClothNormalizeShear(bool val)
-
inline virtual int getSolidSimulationMethod()
-
virtual void setSolidSimulationMethod(const int val)
-
inline virtual Real getSolidStiffness()
-
virtual void setSolidStiffness(Real val)
-
inline virtual Real getSolidPoissonRatio()
-
virtual void setSolidPoissonRatio(Real val)
-
inline virtual Real getSolidVolumeStiffness()
-
virtual void setSolidVolumeStiffness(Real val)
-
inline virtual bool getSolidNormalizeStretch()
-
virtual void setSolidNormalizeStretch(bool val)
-
inline virtual bool getSolidNormalizeShear()
-
virtual void setSolidNormalizeShear(bool val)
-
inline virtual Real getRodStretchingStiffness()
-
virtual void setRodStretchingStiffness(Real val)
-
inline virtual Real getRodShearingStiffnessX()
-
virtual void setRodShearingStiffnessX(Real val)
-
inline virtual Real getRodShearingStiffnessY()
-
virtual void setRodShearingStiffnessY(Real val)
-
inline virtual Real getRodBendingStiffnessX()
-
virtual void setRodBendingStiffnessX(Real val)
-
inline virtual Real getRodBendingStiffnessY()
-
virtual void setRodBendingStiffnessY(Real val)
-
inline virtual Real getRodTwistingStiffness()
-
virtual void setRodTwistingStiffness(Real val)
Public Members
-
bool m_groupsInitialized
Public Static Attributes
-
static int CLOTH_SIMULATION_METHOD = -1
-
static int ENUM_CLOTHSIM_NONE = -1
-
static int ENUM_CLOTHSIM_DISTANCE_CONSTRAINTS = -1
-
static int ENUM_CLOTHSIM_FEM_PBD = -1
-
static int ENUM_CLOTHSIM_SBD = -1
-
static int ENUM_CLOTHSIM_DISTANCE_CONSTRAINTS_XPBD = -1
-
static int CLOTH_STIFFNESS = -1
-
static int CLOTH_STIFFNESS_XX = -1
-
static int CLOTH_STIFFNESS_YY = -1
-
static int CLOTH_STIFFNESS_XY = -1
-
static int CLOTH_POISSON_RATIO_XY = -1
-
static int CLOTH_POISSON_RATIO_YX = -1
-
static int CLOTH_BENDING_METHOD = -1
-
static int ENUM_CLOTH_BENDING_NONE = -1
-
static int ENUM_CLOTH_BENDING_DIHEDRAL_ANGLE = -1
-
static int ENUM_CLOTH_BENDING_ISOMETRIC = -1
-
static int ENUM_CLOTH_BENDING_ISOMETRIX_XPBD = -1
-
static int CLOTH_BENDING_STIFFNESS = -1
-
static int CLOTH_NORMALIZE_STRETCH = -1
-
static int CLOTH_NORMALIZE_SHEAR = -1
-
static int SOLID_SIMULATION_METHOD = -1
-
static int ENUM_SOLIDSIM_NONE = -1
-
static int ENUM_SOLIDSIM_DISTANCE_CONSTRAINTS = -1
-
static int ENUM_SOLIDSIM_FEM_PBD = -1
-
static int ENUM_SOLIDSIM_FEM_XPBD = -1
-
static int ENUM_SOLIDSIM_SBD = -1
-
static int ENUM_SOLIDSIM_SHAPE_MATCHING = -1
-
static int ENUM_SOLIDSIM_DISTANCE_CONSTRAINTS_XPBD = -1
-
static int SOLID_STIFFNESS = -1
-
static int SOLID_POISSON_RATIO = -1
-
static int SOLID_VOLUME_STIFFNESS = -1
-
static int SOLID_NORMALIZE_STRETCH = -1
-
static int SOLID_NORMALIZE_SHEAR = -1
-
static int ROD_STRETCHING_STIFFNESS = -1
-
static int ROD_SHEARING_STIFFNESS_X = -1
-
static int ROD_SHEARING_STIFFNESS_Y = -1
-
static int ROD_BENDING_STIFFNESS_X = -1
-
static int ROD_BENDING_STIFFNESS_Y = -1
-
static int ROD_TWISTING_STIFFNESS = -1
-
static int CONTACT_STIFFNESS_RB = -1
-
static int CONTACT_STIFFNESS_PARTICLE_RB = -1
Protected Attributes
-
RigidBodyVector m_rigidBodies
-
TriangleModelVector m_triangleModels
-
TetModelVector m_tetModels
-
LineModelVector m_lineModels
-
ParticleData m_particles
-
OrientationData m_orientations
-
ConstraintVector m_constraints
-
RigidBodyContactConstraintVector m_rigidBodyContactConstraints
-
ParticleRigidBodyContactConstraintVector m_particleRigidBodyContactConstraints
-
ParticleSolidContactConstraintVector m_particleSolidContactConstraints
-
ConstraintGroupVector m_constraintGroups
-
int m_clothSimulationMethod
-
int m_clothBendingMethod
-
Real m_cloth_stiffness
-
Real m_cloth_bendingStiffness
-
Real m_cloth_xxStiffness
-
Real m_cloth_yyStiffness
-
Real m_cloth_xyStiffness
-
Real m_cloth_xyPoissonRatio
-
Real m_cloth_yxPoissonRatio
-
bool m_cloth_normalizeStretch
-
bool m_cloth_normalizeShear
-
int m_solidSimulationMethod
-
Real m_solid_stiffness
-
Real m_solid_poissonRatio
-
Real m_solid_volumeStiffness
-
bool m_solid_normalizeStretch
-
bool m_solid_normalizeShear
-
Real m_rod_stretchingStiffness
-
Real m_rod_shearingStiffnessX
-
Real m_rod_shearingStiffnessY
-
Real m_rod_bendingStiffnessX
-
Real m_rod_bendingStiffnessY
-
Real m_rod_twistingStiffness
-
Real m_contactStiffnessRigidBody
-
Real m_contactStiffnessParticleRigidBody
-
std::function<void()> m_clothSimMethodChanged
-
std::function<void()> m_clothBendingMethodChanged
-
std::function<void()> m_solidSimMethodChanged
-
typedef std::vector<Constraint*> ConstraintVector