17 #ifndef AGX_MASSPROPERTIES_H
18 #define AGX_MASSPROPERTIES_H
49 AUTO_GENERATE_NONE = 0x0,
53 AUTO_GENERATE_ALL = MASS | CM_OFFSET | INERTIA
77 inline Real getMass()
const;
82 inline const Real& getInvMass()
const;
109 Vec3 getInvMassVector()
const;
139 Vec3 getPrincipalInertiae()
const;
155 const Vec3& getMassCoefficients( )
const;
160 const Vec3& getEffectiveMass()
const;
176 const Vec3& getInertiaTensorCoefficients()
const;
209 const Vec3& getEffectiveMassTransformDiagonal()
const;
231 void setDefaultValues();
245 agx::Physics::RigidBodyPtr m_entity;
255 Real xx, xy, xz, yz, yy, zz, xtx;
281 return m_entity.mass();
288 return m_entity.effectiveMass();
294 return m_entity.effectiveMassCoefficients();
300 return m_entity.effectiveInertiaCoefficients();
305 return m_autoGenerateMask;
311 return m_entity.inertia();
317 return m_entity.effectiveInertia();
323 return m_entity.effectiveMassTransformDiagonal();
330 return m_entity.inertia().getDiagonal();
336 return m_entity.invMass();
342 return Vec3(m_entity.invMass(), m_entity.invMass(), m_entity.invMass());
348 return SPDMatrix3x3(
Vec3(m_entity.invMass(), m_entity.invMass(), m_entity.invMass()) );
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Class for rigid body inertia tensor and mass.
MassProperties(agx::Physics::RigidBodyPtr entity)
Constructor (for internal use) which associates this object to the storage for a RigidBody.
const Vec3 & getEffectiveMassTransformDiagonal() const
bool setMass(Real m, bool autoGenerate=false)
Set the mass.
Vec3 getEffectiveInvMassVector() const
void setAutoGenerateMask(uint32_t mask)
Specify which parameters should be automatically calculated from the geometries of the body given a b...
SPDMatrix3x3 getInvMassMatrix() const
bool setMassCoefficients(const Vec3 &coefficients)
Set mass coefficients.
bool setInertiaTensorCoefficients(const Vec3 &coefficients)
Set inertia tensor coefficients.
SPDMatrix3x3 getEffectiveInvMassMatrix() const
const Real & getInvMass() const
void setEffectiveMassTransformDiagonal(const Vec3 &effectiveMassTransformDiagonal)
Set the transform to transform the effective coefficients to the body/mass frame.
bool setInertiaTensor(const Vec3 &inertiaDiagonal, bool autoGenerate=false)
Set the inertia tensor given the diagonal.
Vec3 getPrincipalInertiae() const
const Vec3 & getInertiaTensorCoefficients() const
const Vec3 & getEffectiveMass() const
virtual ~MassProperties()
Destructor.
bool setInertiaTensor(const SPDMatrix3x3 &m, bool autoGenerate=false)
Set the inertia tensor as a full 3x3 tensor matrix.
const Vec3 & getMassCoefficients() const
AutoGenerateFlags
Specifies a bit mask for controlling what should be automatically calculated when a body/geometry is ...
const SPDMatrix3x3 & getEffectiveInertiaTensor() const
Vec3 getInvMassVector() const
const SPDMatrix3x3 & getInertiaTensor() const
agx::UInt32 getAutoGenerateMask() const
Pointer to a entity instance of type Physics.RigidBody.
The rigid body class, combining a geometric model and a frame of reference.
Specialized type of matrices for holding symmetric positive definite matrices.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.