17 #ifndef AGX_MASSPROPERTIES_H
18 #define AGX_MASSPROPERTIES_H
49 AUTO_GENERATE_NONE = 0x0,
53 AUTO_GENERATE_ALL = MASS | CM_OFFSET | INERTIA
72 bool setMass(
Real m,
bool autoGenerate =
false );
77 inline Real getMass()
const;
82 inline const Real& getInvMass()
const;
93 bool setInertiaTensor(
const SPDMatrix3x3& m,
bool autoGenerate =
false);
104 bool setInertiaTensor(
const Vec3& inertiaDiagonal,
bool autoGenerate =
false);
109 Vec3 getInvMassVector()
const;
129 void setAutoGenerateMask(uint32_t mask);
139 Vec3 getPrincipalInertiae()
const;
150 bool setMassCoefficients(
const Vec3& coefficients );
155 const Vec3& getMassCoefficients( )
const;
160 const Vec3& getEffectiveMass()
const;
171 bool setInertiaTensorCoefficients(
const Vec3& coefficients );
176 const Vec3& getInertiaTensorCoefficients()
const;
187 Vec3 getEffectiveInvMassVector()
const;
204 void setEffectiveMassTransformDiagonal(
const Vec3& effectiveMassTransformDiagonal );
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()) );