33 #ifndef DART_DYNAMICS_SOFTBODYNODE_HPP_ 34 #define DART_DYNAMICS_SOFTBODYNODE_HPP_ 36 #include "dart/dynamics/detail/SoftBodyNodeAspect.hpp" 56 DART_BAKE_SPECIALIZED_ASPECT_IRREGULAR(Aspect, SoftBodyAspect)
103 void setVertexSpringStiffness(
double _kv);
106 double getVertexSpringStiffness()
const;
109 void setEdgeSpringStiffness(
double _ke);
112 double getEdgeSpringStiffness()
const;
115 void setDampingCoefficient(
double _damp);
118 double getDampingCoefficient()
const;
121 void removeAllPointMasses();
127 std::size_t getNumPointMasses()
const;
130 PointMass* getPointMass(std::size_t _idx);
133 const PointMass* getPointMass(std::size_t _idx)
const;
139 void connectPointMasses(std::size_t _idx1, std::size_t _idx2);
142 void addFace(
const Eigen::Vector3i& _face);
145 const Eigen::Vector3i& getFace(std::size_t _idx)
const;
148 std::size_t getNumFaces()
const;
151 void clearConstraintImpulse()
override;
165 bool cloneNodes)
const override;
175 void init(
const SkeletonPtr& _skeleton)
override;
192 void updateTransform()
override;
195 void updateVelocity()
override;
198 void updatePartialAcceleration()
const override;
201 void updateArtInertia(
double _timeStep)
const override;
204 void updateBiasForce(
205 const Eigen::Vector3d& _gravity,
double _timeStep)
override;
208 void updateBiasImpulse()
override;
211 void updateAccelerationID()
override;
214 void updateAccelerationFD()
override;
217 void updateVelocityChangeFD()
override;
220 void updateTransmittedForceID(
221 const Eigen::Vector3d& _gravity,
222 bool _withExternalForces =
false)
override;
225 void updateTransmittedForceFD()
override;
228 void updateTransmittedImpulse()
override;
231 void updateJointForceID(
233 bool _withDampingForces,
234 bool _withSpringForces)
override;
237 void updateJointForceFD(
239 bool _withDampingForces,
240 bool _withSpringForces)
override;
243 void updateJointImpulseFD()
override;
246 void updateConstrainedTerms(
double _timeStep)
override;
255 void updateMassMatrix()
override;
258 void aggregateMassMatrix(Eigen::MatrixXd& _MCol, std::size_t _col)
override;
261 void aggregateAugMassMatrix(
262 Eigen::MatrixXd& _MCol, std::size_t _col,
double _timeStep)
override;
265 void updateInvMassMatrix()
override;
271 void aggregateInvMassMatrix(
272 Eigen::MatrixXd& _InvMCol, std::size_t _col)
override;
276 Eigen::MatrixXd& _InvMCol, std::size_t _col,
double _timeStep)
override;
280 void aggregateCoriolisForceVector(Eigen::VectorXd& _C)
override;
283 void aggregateGravityForceVector(
284 Eigen::VectorXd& _g,
const Eigen::Vector3d& _gravity)
override;
287 void updateCombinedVector()
override;
290 void aggregateCombinedVector(
291 Eigen::VectorXd& _Cg,
const Eigen::Vector3d& _gravity)
override;
294 void aggregateExternalForces(Eigen::VectorXd& _Fext)
override;
299 void clearExternalForces()
override;
301 void clearInternalForces()
override;
317 math::Inertia mArtInertia2;
320 math::Inertia mArtInertiaImplicit2;
324 void _addPiToArtInertia(
const Eigen::Vector3d& _p,
double _Pi)
const;
327 void _addPiToArtInertiaImplicit(
328 const Eigen::Vector3d& _p,
double _ImplicitPi)
const;
331 void updateInertiaWithPointMass();
340 const Eigen::Vector3d& _size,
341 const Eigen::Isometry3d& _localTransform,
343 double _vertexStiffness = DART_DEFAULT_VERTEX_STIFFNESS,
344 double _edgeStiffness = DART_DEFAULT_EDGE_STIFNESS,
345 double _dampingCoeff = DART_DEFAULT_DAMPING_COEFF);
351 const Eigen::Vector3d& _size,
352 const Eigen::Isometry3d& _localTransform,
354 double _vertexStiffness = DART_DEFAULT_VERTEX_STIFFNESS,
355 double _edgeStiffness = DART_DEFAULT_EDGE_STIFNESS,
356 double _dampingCoeff = DART_DEFAULT_DAMPING_COEFF);
363 const Eigen::Vector3d& _size,
364 const Eigen::Isometry3d& _localTransform,
365 const Eigen::Vector3i& _frags,
367 double _vertexStiffness = DART_DEFAULT_VERTEX_STIFFNESS,
368 double _edgeStiffness = DART_DEFAULT_EDGE_STIFNESS,
369 double _dampingCoeff = DART_DEFAULT_DAMPING_COEFF);
386 const Eigen::Vector3d& _size,
387 const Eigen::Isometry3d& _localTransform,
388 const Eigen::Vector3i& _frags,
390 double _vertexStiffness = DART_DEFAULT_VERTEX_STIFFNESS,
391 double _edgeStiffness = DART_DEFAULT_EDGE_STIFNESS,
392 double _dampingCoeff = DART_DEFAULT_DAMPING_COEFF);
397 double _vertexStiffness = DART_DEFAULT_VERTEX_STIFFNESS,
398 double _edgeStiffness = DART_DEFAULT_EDGE_STIFNESS,
399 double _dampingCoeff = DART_DEFAULT_DAMPING_COEFF);
403 static void setSinglePointMass(
406 double _vertexStiffness = DART_DEFAULT_VERTEX_STIFFNESS,
407 double _edgeStiffness = DART_DEFAULT_EDGE_STIFNESS,
408 double _dampingCoeff = DART_DEFAULT_DAMPING_COEFF);
413 std::size_t _nSlices,
414 std::size_t _nStacks,
416 double _vertexStiffness = DART_DEFAULT_VERTEX_STIFFNESS,
417 double _edgeStiffness = DART_DEFAULT_EDGE_STIFNESS,
418 double _dampingCoeff = DART_DEFAULT_DAMPING_COEFF);
422 const Eigen::Vector3d& _size,
423 std::size_t _nSlices,
424 std::size_t _nStacks,
426 double _vertexStiffness = DART_DEFAULT_VERTEX_STIFFNESS,
427 double _edgeStiffness = DART_DEFAULT_EDGE_STIFNESS,
428 double _dampingCoeff = DART_DEFAULT_DAMPING_COEFF);
432 static void setEllipsoid(
434 const Eigen::Vector3d& _size,
435 std::size_t _nSlices,
436 std::size_t _nStacks,
438 double _vertexStiffness = DART_DEFAULT_VERTEX_STIFFNESS,
439 double _edgeStiffness = DART_DEFAULT_EDGE_STIFNESS,
440 double _dampingCoeff = DART_DEFAULT_DAMPING_COEFF);
446 std::size_t _nSlices,
447 std::size_t _nStacks,
450 double _vertexStiffness = DART_DEFAULT_VERTEX_STIFFNESS,
451 double _edgeStiffness = DART_DEFAULT_EDGE_STIFNESS,
452 double _dampingCoeff = DART_DEFAULT_DAMPING_COEFF);
456 static void setCylinder(
460 std::size_t _nSlices,
461 std::size_t _nStacks,
464 double _vertexStiffness = DART_DEFAULT_VERTEX_STIFFNESS,
465 double _edgeStiffness = DART_DEFAULT_EDGE_STIFNESS,
466 double _dampingCoeff = DART_DEFAULT_DAMPING_COEFF);
472 #endif // DART_DYNAMICS_SOFTBODYNODE_HPP_ void setAspectProperties(const AspectProperties &properties)
Set the AspectProperties of this SoftBodyNode.
Definition: SoftBodyNode.cpp:177
class Joint
Definition: Joint.hpp:57
Definition: SoftBodyNodeAspect.hpp:65
std::shared_ptr< Skeleton > getSkeleton()
Return the Skeleton this BodyNode belongs to.
Definition: BodyNode.cpp:155
SoftBodyNode represent a soft body that has one deformable skin.
Definition: SoftBodyNode.hpp:45
Properties for each PointMass.
Definition: PointMass.hpp:83
void copy(const SoftBodyNode &_otherSoftBodyNode)
Copy the Properties of another SoftBodyNode.
Definition: SoftBodyNode.cpp:199
Definition: SoftBodyNode.hpp:334
This is an alternative to EmbedStateAndProperties which allows your class to also inherit other Compo...
Definition: EmbeddedAspect.hpp:431
math::Inertia mI2
Generalized inertia with point masses.
Definition: SoftBodyNode.hpp:314
WeakShapeNodePtr mSoftShapeNode
Soft mesh shape belonging to this node.
Definition: SoftBodyNode.hpp:311
PointMassNotifier * mNotifier
An Entity which tracks when the point masses need to be updated.
Definition: SoftBodyNode.hpp:308
Definition: Aspect.cpp:40
Terminator for the variadic template.
Definition: CompositeJoiner.hpp:44
BodyNode * clone(BodyNode *_parentBodyNode, Joint *_parentJoint, bool cloneNodes) const override
Create a clone of this SoftBodyNode.
Definition: SoftBodyNode.cpp:277
Definition: PointMass.hpp:50
PointMassNotifier * getNotifier()
Get the update notifier for the PointMasses of this SoftBodyNode.
Definition: SoftBodyNode.cpp:399
void setAspectState(const AspectState &state)
Set the AspectState of this SoftBodyNode.
Definition: SoftBodyNode.cpp:167
void updateInvAugMassMatrix() override
Definition: SoftBodyNode.cpp:997
SoftBodyNode & operator=(const SoftBodyNode &_otherSoftBodyNode)
Copy the Properties of another SoftBodyNode.
Definition: SoftBodyNode.cpp:217
Definition: ShapeNode.hpp:48
void configurePointMasses(ShapeNode *softNode)
Used by SoftBodyAspect to have this SoftBodyNode reconstruct its SoftMeshShape.
Definition: SoftBodyNode.cpp:292
Properties getSoftBodyNodeProperties() const
Get the Properties of this SoftBodyNode.
Definition: SoftBodyNode.cpp:193
BodyNode class represents a single node of the skeleton.
Definition: BodyNode.hpp:74
const std::vector< PointMass * > & getPointMasses() const
Return all the point masses in this SoftBodyNode.
Definition: SoftBodyNode.cpp:246
double getMass() const
Get mass.
Definition: SoftBodyNode.cpp:411
SoftBodyNode(BodyNode *_parentBodyNode, Joint *_parentJoint, const Properties &_properties)
Constructor called by Skeleton class.
Definition: SoftBodyNode.cpp:252
std::vector< PointMass * > mPointMasses
List of point masses composing deformable mesh.
Definition: SoftBodyNode.hpp:305
void setProperties(const Properties &_properties)
Set the Properties of this SoftBodyNode.
Definition: SoftBodyNode.cpp:152
void aggregateInvAugMassMatrix(Eigen::MatrixXd &_InvMCol, std::size_t _col, double _timeStep) override
Definition: SoftBodyNode.cpp:1067
class Skeleton
Definition: Skeleton.hpp:55
void checkArticulatedInertiaUpdate() const
Update articulated inertia if necessary.
Definition: SoftBodyNode.cpp:536
Definition: SoftBodyNodeAspect.hpp:107
Definition: PointMass.hpp:672