33 #ifndef DART_DYNAMICS_SOFTBODYNODE_HPP_
34 #define DART_DYNAMICS_SOFTBODYNODE_HPP_
143 void addFace(
const Eigen::Vector3i& _face);
146 const Eigen::Vector3i&
getFace(std::size_t _idx)
const;
163 bool cloneNodes)
const override;
202 double _timeStep)
override;
218 const Eigen::Vector3d& _gravity,
219 bool _withExternalForces =
false)
override;
229 bool _withDampingForces,
230 bool _withSpringForces)
override;
234 bool _withDampingForces,
235 bool _withSpringForces)
override;
257 double _timeStep)
override;
270 double _timeStep)
override;
278 const Eigen::Vector3d& _gravity)
override;
285 const Eigen::Vector3d& _gravity)
override;
323 double _ImplicitPi)
const;
336 const Eigen::Vector3d& _size,
337 const Eigen::Isometry3d& _localTransform,
346 const Eigen::Vector3d& _size,
347 const Eigen::Isometry3d& _localTransform,
358 const Eigen::Vector3d& _size,
359 const Eigen::Isometry3d& _localTransform,
360 const Eigen::Vector3i& _frags,
373 const Eigen::Vector3d& _size,
374 const Eigen::Isometry3d& _localTransform,
375 const Eigen::Vector3i& _frags,
400 std::size_t _nSlices,
401 std::size_t _nStacks,
409 const Eigen::Vector3d& _size,
410 std::size_t _nSlices,
411 std::size_t _nStacks,
420 const Eigen::Vector3d& _size,
421 std::size_t _nSlices,
422 std::size_t _nStacks,
432 std::size_t _nSlices,
433 std::size_t _nStacks,
445 std::size_t _nSlices,
446 std::size_t _nStacks,
BodyPropPtr properties
Definition: SdfParser.cpp:80
Terminator for the variadic template.
Definition: CompositeJoiner.hpp:45
This is an alternative to EmbedStateAndProperties which allows your class to also inherit other Compo...
Definition: EmbeddedAspect.hpp:438
typename Impl::AspectState AspectState
Definition: EmbeddedAspect.hpp:444
typename Impl::Aspect Aspect
Definition: EmbeddedAspect.hpp:447
typename Impl::AspectProperties AspectProperties
Definition: EmbeddedAspect.hpp:446
BodyNode class represents a single node of the skeleton.
Definition: BodyNode.hpp:78
class Joint
Definition: Joint.hpp:59
Definition: PointMass.hpp:673
Definition: PointMass.hpp:51
Definition: ShapeNode.hpp:49
std::shared_ptr< Skeleton > getSkeleton()
Return the Skeleton this BodyNode belongs to.
Definition: BodyNode.cpp:149
class Skeleton
Definition: Skeleton.hpp:59
Definition: SoftBodyNode.hpp:330
static void setCylinder(SoftBodyNode *_softBodyNode, double _radius, double _height, std::size_t _nSlices, std::size_t _nStacks, std::size_t _nRings, double _totalMass, double _vertexStiffness=DART_DEFAULT_VERTEX_STIFFNESS, double _edgeStiffness=DART_DEFAULT_EDGE_STIFNESS, double _dampingCoeff=DART_DEFAULT_DAMPING_COEFF)
This should be called before SoftBodyNode::init() is called.
Definition: SoftBodyNode.cpp:3049
static void setSinglePointMass(SoftBodyNode *_softBodyNode, double _totalMass, double _vertexStiffness=DART_DEFAULT_VERTEX_STIFFNESS, double _edgeStiffness=DART_DEFAULT_EDGE_STIFNESS, double _dampingCoeff=DART_DEFAULT_DAMPING_COEFF)
This should be called before SoftBodyNode::init() is called.
Definition: SoftBodyNode.cpp:2499
static SoftBodyNode::UniqueProperties makeEllipsoidProperties(const Eigen::Vector3d &_size, std::size_t _nSlices, std::size_t _nStacks, double _totalMass, double _vertexStiffness=DART_DEFAULT_VERTEX_STIFFNESS, double _edgeStiffness=DART_DEFAULT_EDGE_STIFNESS, double _dampingCoeff=DART_DEFAULT_DAMPING_COEFF)
Create a Properties struct for an Ellipsoid-shaped SoftBodyNode.
Definition: SoftBodyNode.cpp:2534
static void setBox(SoftBodyNode *_softBodyNode, const Eigen::Vector3d &_size, const Eigen::Isometry3d &_localTransform, double _totalMass, double _vertexStiffness=DART_DEFAULT_VERTEX_STIFFNESS, double _edgeStiffness=DART_DEFAULT_EDGE_STIFNESS, double _dampingCoeff=DART_DEFAULT_DAMPING_COEFF)
This should be called before SoftBodyNode::init() is called.
Definition: SoftBodyNode.cpp:1358
static SoftBodyNode::UniqueProperties makeBoxProperties(const Eigen::Vector3d &_size, const Eigen::Isometry3d &_localTransform, double _totalMass, double _vertexStiffness=DART_DEFAULT_VERTEX_STIFFNESS, double _edgeStiffness=DART_DEFAULT_EDGE_STIFNESS, double _dampingCoeff=DART_DEFAULT_DAMPING_COEFF)
Create a Properties struct for a box-shaped SoftBodyNode with 8 PointMasses.
Definition: SoftBodyNode.cpp:1266
static SoftBodyNode::UniqueProperties makeSinglePointMassProperties(double _totalMass, double _vertexStiffness=DART_DEFAULT_VERTEX_STIFFNESS, double _edgeStiffness=DART_DEFAULT_EDGE_STIFNESS, double _dampingCoeff=DART_DEFAULT_DAMPING_COEFF)
Create a Properties struct for a SoftBodyNode with a single PointMass.
Definition: SoftBodyNode.cpp:2465
static SoftBodyNode::UniqueProperties makeCylinderProperties(double _radius, double _height, std::size_t _nSlices, std::size_t _nStacks, std::size_t _nRings, double _totalMass, double _vertexStiffness=DART_DEFAULT_VERTEX_STIFFNESS, double _edgeStiffness=DART_DEFAULT_EDGE_STIFNESS, double _dampingCoeff=DART_DEFAULT_DAMPING_COEFF)
Create a Properties struct for a cylinder-shaped SoftBodyNode.
Definition: SoftBodyNode.cpp:2715
static SoftBodyNode::UniqueProperties makeSphereProperties(double _radius, std::size_t _nSlices, std::size_t _nStacks, double _totalMass, double _vertexStiffness=DART_DEFAULT_VERTEX_STIFFNESS, double _edgeStiffness=DART_DEFAULT_EDGE_STIFNESS, double _dampingCoeff=DART_DEFAULT_DAMPING_COEFF)
Create a Properties struct for an Sphere-shaped SoftBodyNode.
Definition: SoftBodyNode.cpp:2514
static void setEllipsoid(SoftBodyNode *_softBodyNode, const Eigen::Vector3d &_size, std::size_t _nSlices, std::size_t _nStacks, double _totalMass, double _vertexStiffness=DART_DEFAULT_VERTEX_STIFFNESS, double _edgeStiffness=DART_DEFAULT_EDGE_STIFNESS, double _dampingCoeff=DART_DEFAULT_DAMPING_COEFF)
This should be called before SoftBodyNode::init() is called.
Definition: SoftBodyNode.cpp:2695
SoftBodyNode represent a soft body that has one deformable skin.
Definition: SoftBodyNode.hpp:46
PointMassNotifier * mNotifier
An Entity which tracks when the point masses need to be updated.
Definition: SoftBodyNode.hpp:303
void copy(const SoftBodyNode &_otherSoftBodyNode)
Copy the Properties of another SoftBodyNode.
Definition: SoftBodyNode.cpp:190
void _addPiToArtInertia(const Eigen::Vector3d &_p, double _Pi) const
Definition: SoftBodyNode.cpp:1222
void updateTransmittedForceFD() override
Definition: SoftBodyNode.cpp:766
void updateArtInertia(double _timeStep) const override
Definition: SoftBodyNode.cpp:660
Properties getSoftBodyNodeProperties() const
Get the Properties of this SoftBodyNode.
Definition: SoftBodyNode.cpp:184
void updateJointImpulseFD() override
Definition: SoftBodyNode.cpp:654
void aggregateGravityForceVector(Eigen::VectorXd &_g, const Eigen::Vector3d &_gravity) override
Definition: SoftBodyNode.cpp:1078
void updateMassMatrix() override
Definition: SoftBodyNode.cpp:834
void setAspectProperties(const AspectProperties &properties)
Set the AspectProperties of this SoftBodyNode.
Definition: SoftBodyNode.cpp:168
void updatePartialAcceleration() const override
Definition: SoftBodyNode.cpp:556
PointMass * addPointMass(const PointMass::Properties &_properties)
Definition: SoftBodyNode.cpp:475
void updateAccelerationFD() override
Definition: SoftBodyNode.cpp:755
std::vector< PointMass * > mPointMasses
List of point masses composing deformable mesh.
Definition: SoftBodyNode.hpp:300
BodyNode * clone(BodyNode *_parentBodyNode, Joint *_parentJoint, bool cloneNodes) const override
Create a clone of this SoftBodyNode.
Definition: SoftBodyNode.cpp:267
void updateBiasImpulse() override
Definition: SoftBodyNode.cpp:775
void aggregateInvMassMatrix(Eigen::MatrixXd &_InvMCol, std::size_t _col) override
Definition: SoftBodyNode.cpp:1007
void setAspectState(const AspectState &state)
Set the AspectState of this SoftBodyNode.
Definition: SoftBodyNode.cpp:158
WeakShapeNodePtr mSoftShapeNode
Soft mesh shape belonging to this node.
Definition: SoftBodyNode.hpp:306
void updateJointForceID(double _timeStep, bool _withDampingForces, bool _withSpringForces) override
Definition: SoftBodyNode.cpp:629
std::size_t getNumFaces() const
Definition: SoftBodyNode.cpp:511
void clearConstraintImpulse() override
Definition: SoftBodyNode.cpp:517
double getEdgeSpringStiffness() const
Definition: SoftBodyNode.cpp:442
math::Inertia mArtInertia2
Definition: SoftBodyNode.hpp:312
void aggregateAugMassMatrix(Eigen::MatrixXd &_MCol, std::size_t _col, double _timeStep) override
Definition: SoftBodyNode.cpp:887
void setVertexSpringStiffness(double _kv)
Definition: SoftBodyNode.cpp:412
void connectPointMasses(std::size_t _idx1, std::size_t _idx2)
Definition: SoftBodyNode.cpp:486
void updateVelocity() override
Definition: SoftBodyNode.cpp:545
void removeAllPointMasses()
Definition: SoftBodyNode.cpp:466
const std::vector< PointMass * > & getPointMasses() const
Return all the point masses in this SoftBodyNode.
Definition: SoftBodyNode.cpp:237
void aggregateCombinedVector(Eigen::VectorXd &_Cg, const Eigen::Vector3d &_gravity) override
Definition: SoftBodyNode.cpp:1126
void updateConstrainedTerms(double _timeStep) override
Definition: SoftBodyNode.cpp:825
void aggregateCoriolisForceVector(Eigen::VectorXd &_C) override
Definition: SoftBodyNode.cpp:1072
void addFace(const Eigen::Vector3i &_face)
Definition: SoftBodyNode.cpp:497
void updateBiasForce(const Eigen::Vector3d &_gravity, double _timeStep) override
Definition: SoftBodyNode.cpp:705
math::Inertia mI2
Generalized inertia with point masses.
Definition: SoftBodyNode.hpp:309
void setProperties(const Properties &_properties)
Set the Properties of this SoftBodyNode.
Definition: SoftBodyNode.cpp:143
double getMass() const
Get mass.
Definition: SoftBodyNode.cpp:401
void updateInertiaWithPointMass()
Definition: SoftBodyNode.cpp:1251
void updateInvAugMassMatrix() override
Definition: SoftBodyNode.cpp:971
std::size_t getNumPointMasses() const
Definition: SoftBodyNode.cpp:215
void init(const SkeletonPtr &_skeleton) override
Definition: SoftBodyNode.cpp:343
void updateJointForceFD(double _timeStep, bool _withDampingForces, bool _withSpringForces) override
Definition: SoftBodyNode.cpp:644
void aggregateMassMatrix(Eigen::MatrixXd &_MCol, std::size_t _col) override
Definition: SoftBodyNode.cpp:843
void setDampingCoefficient(double _damp)
Definition: SoftBodyNode.cpp:448
void configurePointMasses(ShapeNode *softNode)
Used by SoftBodyAspect to have this SoftBodyNode reconstruct its SoftMeshShape.
Definition: SoftBodyNode.cpp:282
void updateTransform() override
Definition: SoftBodyNode.cpp:534
void updateVelocityChangeFD() override
Definition: SoftBodyNode.cpp:807
PointMass * getPointMass(std::size_t _idx)
Definition: SoftBodyNode.cpp:221
void clearInternalForces() override
Definition: SoftBodyNode.cpp:1213
SoftBodyNode & operator=(const SoftBodyNode &_otherSoftBodyNode)
Copy the Properties of another SoftBodyNode.
Definition: SoftBodyNode.cpp:208
void _addPiToArtInertiaImplicit(const Eigen::Vector3d &_p, double _ImplicitPi) const
Definition: SoftBodyNode.cpp:1236
void clearExternalForces() override
Definition: SoftBodyNode.cpp:1204
virtual ~SoftBodyNode()
Definition: SoftBodyNode.cpp:122
void updateTransmittedForceID(const Eigen::Vector3d &_gravity, bool _withExternalForces=false) override
Definition: SoftBodyNode.cpp:578
SoftBodyNode(BodyNode *_parentBodyNode, Joint *_parentJoint, const Properties &_properties)
Constructor called by Skeleton class.
Definition: SoftBodyNode.cpp:243
void aggregateExternalForces(Eigen::VectorXd &_Fext) override
Definition: SoftBodyNode.cpp:1170
void aggregateInvAugMassMatrix(Eigen::MatrixXd &_InvMCol, std::size_t _col, double _timeStep) override
Definition: SoftBodyNode.cpp:1038
math::Inertia mArtInertiaImplicit2
Definition: SoftBodyNode.hpp:315
void updateInvMassMatrix() override
Definition: SoftBodyNode.cpp:937
void updateCombinedVector() override
Definition: SoftBodyNode.cpp:1117
void checkArticulatedInertiaUpdate() const
Update articulated inertia if necessary.
Definition: SoftBodyNode.cpp:526
PointMassNotifier * getNotifier()
Get the update notifier for the PointMasses of this SoftBodyNode.
Definition: SoftBodyNode.cpp:389
double getVertexSpringStiffness() const
Definition: SoftBodyNode.cpp:424
SoftBodyNode * asSoftBodyNode() override
Definition: SoftBodyNode.cpp:131
double getDampingCoefficient() const
Definition: SoftBodyNode.cpp:460
void updateTransmittedImpulse() override
Definition: SoftBodyNode.cpp:816
void setEdgeSpringStiffness(double _ke)
Definition: SoftBodyNode.cpp:430
const Eigen::Vector3i & getFace(std::size_t _idx) const
Definition: SoftBodyNode.cpp:504
void updateAccelerationID() override
Definition: SoftBodyNode.cpp:567
#define DART_BAKE_SPECIALIZED_ASPECT_IRREGULAR(TypeName, AspectName)
Definition: Composite.hpp:164
common::EmbedStateAndPropertiesOnTopOf< SoftBodyNode, SoftBodyNodeUniqueState, SoftBodyNodeUniqueProperties, BodyNode > SoftBodyNodeBase
Definition: SoftBodyNodeAspect.hpp:123
const double DART_DEFAULT_DAMPING_COEFF
Definition: SoftBodyNodeAspect.hpp:45
const double DART_DEFAULT_VERTEX_STIFFNESS
Definition: SoftBodyNodeAspect.hpp:43
std::shared_ptr< Skeleton > SkeletonPtr
Definition: SmartPointer.hpp:60
const double DART_DEFAULT_EDGE_STIFNESS
Definition: SoftBodyNodeAspect.hpp:44
Eigen::Matrix6d Inertia
Definition: MathTypes.hpp:105
Definition: BulletCollisionDetector.cpp:63
Properties for each PointMass.
Definition: PointMass.hpp:83
Definition: SoftBodyNodeAspect.hpp:109
Definition: SoftBodyNodeAspect.hpp:66