33 #ifndef DART_DYNAMICS_SOFTBODYNODE_HPP_
34 #define DART_DYNAMICS_SOFTBODYNODE_HPP_
142 void addFace(
const Eigen::Vector3i& _face);
145 const Eigen::Vector3i&
getFace(std::size_t _idx)
const;
165 bool cloneNodes)
const override;
205 const Eigen::Vector3d& _gravity,
double _timeStep)
override;
221 const Eigen::Vector3d& _gravity,
222 bool _withExternalForces =
false)
override;
233 bool _withDampingForces,
234 bool _withSpringForces)
override;
239 bool _withDampingForces,
240 bool _withSpringForces)
override;
262 Eigen::MatrixXd& _MCol, std::size_t _col,
double _timeStep)
override;
272 Eigen::MatrixXd& _InvMCol, std::size_t _col)
override;
276 Eigen::MatrixXd& _InvMCol, std::size_t _col,
double _timeStep)
override;
284 Eigen::VectorXd& _g,
const Eigen::Vector3d& _gravity)
override;
291 Eigen::VectorXd& _Cg,
const Eigen::Vector3d& _gravity)
override;
328 const Eigen::Vector3d& _p,
double _ImplicitPi)
const;
340 const Eigen::Vector3d& _size,
341 const Eigen::Isometry3d& _localTransform,
351 const Eigen::Vector3d& _size,
352 const Eigen::Isometry3d& _localTransform,
363 const Eigen::Vector3d& _size,
364 const Eigen::Isometry3d& _localTransform,
365 const Eigen::Vector3i& _frags,
386 const Eigen::Vector3d& _size,
387 const Eigen::Isometry3d& _localTransform,
388 const Eigen::Vector3i& _frags,
413 std::size_t _nSlices,
414 std::size_t _nStacks,
422 const Eigen::Vector3d& _size,
423 std::size_t _nSlices,
424 std::size_t _nStacks,
434 const Eigen::Vector3d& _size,
435 std::size_t _nSlices,
436 std::size_t _nStacks,
446 std::size_t _nSlices,
447 std::size_t _nStacks,
460 std::size_t _nSlices,
461 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:435
typename Impl::AspectState AspectState
Definition: EmbeddedAspect.hpp:440
typename Impl::Aspect Aspect
Definition: EmbeddedAspect.hpp:443
typename Impl::AspectProperties AspectProperties
Definition: EmbeddedAspect.hpp:442
BodyNode class represents a single node of the skeleton.
Definition: BodyNode.hpp:79
class Joint
Definition: Joint.hpp:60
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:152
class Skeleton
Definition: Skeleton.hpp:59
Definition: SoftBodyNode.hpp:335
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:3098
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:2549
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:2582
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:1396
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:1304
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:2515
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:2762
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:2562
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:2740
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:308
void copy(const SoftBodyNode &_otherSoftBodyNode)
Copy the Properties of another SoftBodyNode.
Definition: SoftBodyNode.cpp:199
void _addPiToArtInertia(const Eigen::Vector3d &_p, double _Pi) const
Definition: SoftBodyNode.cpp:1260
void updateTransmittedForceFD() override
Definition: SoftBodyNode.cpp:783
void updateArtInertia(double _timeStep) const override
Definition: SoftBodyNode.cpp:666
Properties getSoftBodyNodeProperties() const
Get the Properties of this SoftBodyNode.
Definition: SoftBodyNode.cpp:193
void updateJointImpulseFD() override
Definition: SoftBodyNode.cpp:660
void aggregateGravityForceVector(Eigen::VectorXd &_g, const Eigen::Vector3d &_gravity) override
Definition: SoftBodyNode.cpp:1109
void updateMassMatrix() override
Definition: SoftBodyNode.cpp:853
void setAspectProperties(const AspectProperties &properties)
Set the AspectProperties of this SoftBodyNode.
Definition: SoftBodyNode.cpp:177
void updatePartialAcceleration() const override
Definition: SoftBodyNode.cpp:566
PointMass * addPointMass(const PointMass::Properties &_properties)
Definition: SoftBodyNode.cpp:485
void updateAccelerationFD() override
Definition: SoftBodyNode.cpp:772
std::vector< PointMass * > mPointMasses
List of point masses composing deformable mesh.
Definition: SoftBodyNode.hpp:305
BodyNode * clone(BodyNode *_parentBodyNode, Joint *_parentJoint, bool cloneNodes) const override
Create a clone of this SoftBodyNode.
Definition: SoftBodyNode.cpp:277
void updateBiasImpulse() override
Definition: SoftBodyNode.cpp:792
void aggregateInvMassMatrix(Eigen::MatrixXd &_InvMCol, std::size_t _col) override
Definition: SoftBodyNode.cpp:1035
void setAspectState(const AspectState &state)
Set the AspectState of this SoftBodyNode.
Definition: SoftBodyNode.cpp:167
WeakShapeNodePtr mSoftShapeNode
Soft mesh shape belonging to this node.
Definition: SoftBodyNode.hpp:311
void updateJointForceID(double _timeStep, bool _withDampingForces, bool _withSpringForces) override
Definition: SoftBodyNode.cpp:640
std::size_t getNumFaces() const
Definition: SoftBodyNode.cpp:521
void clearConstraintImpulse() override
Definition: SoftBodyNode.cpp:527
double getEdgeSpringStiffness() const
Definition: SoftBodyNode.cpp:452
math::Inertia mArtInertia2
Definition: SoftBodyNode.hpp:317
void aggregateAugMassMatrix(Eigen::MatrixXd &_MCol, std::size_t _col, double _timeStep) override
Definition: SoftBodyNode.cpp:908
void setVertexSpringStiffness(double _kv)
Definition: SoftBodyNode.cpp:422
void connectPointMasses(std::size_t _idx1, std::size_t _idx2)
Definition: SoftBodyNode.cpp:496
void updateVelocity() override
Definition: SoftBodyNode.cpp:555
void removeAllPointMasses()
Definition: SoftBodyNode.cpp:476
const std::vector< PointMass * > & getPointMasses() const
Return all the point masses in this SoftBodyNode.
Definition: SoftBodyNode.cpp:246
void aggregateCombinedVector(Eigen::VectorXd &_Cg, const Eigen::Vector3d &_gravity) override
Definition: SoftBodyNode.cpp:1160
void updateConstrainedTerms(double _timeStep) override
Definition: SoftBodyNode.cpp:844
void aggregateCoriolisForceVector(Eigen::VectorXd &_C) override
Definition: SoftBodyNode.cpp:1103
void addFace(const Eigen::Vector3i &_face)
Definition: SoftBodyNode.cpp:507
void updateBiasForce(const Eigen::Vector3d &_gravity, double _timeStep) override
Definition: SoftBodyNode.cpp:711
math::Inertia mI2
Generalized inertia with point masses.
Definition: SoftBodyNode.hpp:314
void setProperties(const Properties &_properties)
Set the Properties of this SoftBodyNode.
Definition: SoftBodyNode.cpp:152
double getMass() const
Get mass.
Definition: SoftBodyNode.cpp:411
void updateInertiaWithPointMass()
Definition: SoftBodyNode.cpp:1290
void updateInvAugMassMatrix() override
Definition: SoftBodyNode.cpp:997
std::size_t getNumPointMasses() const
Definition: SoftBodyNode.cpp:224
void init(const SkeletonPtr &_skeleton) override
Definition: SoftBodyNode.cpp:353
void updateJointForceFD(double _timeStep, bool _withDampingForces, bool _withSpringForces) override
Definition: SoftBodyNode.cpp:652
void aggregateMassMatrix(Eigen::MatrixXd &_MCol, std::size_t _col) override
Definition: SoftBodyNode.cpp:862
void setDampingCoefficient(double _damp)
Definition: SoftBodyNode.cpp:458
void configurePointMasses(ShapeNode *softNode)
Used by SoftBodyAspect to have this SoftBodyNode reconstruct its SoftMeshShape.
Definition: SoftBodyNode.cpp:292
void updateTransform() override
Definition: SoftBodyNode.cpp:544
void updateVelocityChangeFD() override
Definition: SoftBodyNode.cpp:826
PointMass * getPointMass(std::size_t _idx)
Definition: SoftBodyNode.cpp:230
void clearInternalForces() override
Definition: SoftBodyNode.cpp:1251
SoftBodyNode & operator=(const SoftBodyNode &_otherSoftBodyNode)
Copy the Properties of another SoftBodyNode.
Definition: SoftBodyNode.cpp:217
void _addPiToArtInertiaImplicit(const Eigen::Vector3d &_p, double _ImplicitPi) const
Definition: SoftBodyNode.cpp:1275
void clearExternalForces() override
Definition: SoftBodyNode.cpp:1242
virtual ~SoftBodyNode()
Definition: SoftBodyNode.cpp:131
void updateTransmittedForceID(const Eigen::Vector3d &_gravity, bool _withExternalForces=false) override
Definition: SoftBodyNode.cpp:588
SoftBodyNode(BodyNode *_parentBodyNode, Joint *_parentJoint, const Properties &_properties)
Constructor called by Skeleton class.
Definition: SoftBodyNode.cpp:252
void aggregateExternalForces(Eigen::VectorXd &_Fext) override
Definition: SoftBodyNode.cpp:1206
void aggregateInvAugMassMatrix(Eigen::MatrixXd &_InvMCol, std::size_t _col, double _timeStep) override
Definition: SoftBodyNode.cpp:1067
math::Inertia mArtInertiaImplicit2
Definition: SoftBodyNode.hpp:320
void updateInvMassMatrix() override
Definition: SoftBodyNode.cpp:960
void updateCombinedVector() override
Definition: SoftBodyNode.cpp:1151
void checkArticulatedInertiaUpdate() const
Update articulated inertia if necessary.
Definition: SoftBodyNode.cpp:536
PointMassNotifier * getNotifier()
Get the update notifier for the PointMasses of this SoftBodyNode.
Definition: SoftBodyNode.cpp:399
double getVertexSpringStiffness() const
Definition: SoftBodyNode.cpp:434
SoftBodyNode * asSoftBodyNode() override
Definition: SoftBodyNode.cpp:140
double getDampingCoefficient() const
Definition: SoftBodyNode.cpp:470
void updateTransmittedImpulse() override
Definition: SoftBodyNode.cpp:835
void setEdgeSpringStiffness(double _ke)
Definition: SoftBodyNode.cpp:440
const Eigen::Vector3i & getFace(std::size_t _idx) const
Definition: SoftBodyNode.cpp:514
void updateAccelerationID() override
Definition: SoftBodyNode.cpp:577
#define DART_BAKE_SPECIALIZED_ASPECT_IRREGULAR(TypeName, AspectName)
Definition: Composite.hpp:164
common::EmbedStateAndPropertiesOnTopOf< SoftBodyNode, SoftBodyNodeUniqueState, SoftBodyNodeUniqueProperties, BodyNode > SoftBodyNodeBase
Definition: SoftBodyNodeAspect.hpp:125
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:111
Definition: BulletCollisionDetector.cpp:65
Properties for each PointMass.
Definition: PointMass.hpp:84
Definition: SoftBodyNodeAspect.hpp:109
Definition: SoftBodyNodeAspect.hpp:66