|
AGX Dynamics 2.42.3.1
|
Class for rigid body inertia tensor and mass. More...
#include <MassProperties.h>
Inheritance diagram for agx::MassProperties:Public Types | |
| enum | AutoGenerateFlags { AUTO_GENERATE_NONE = 0x0 , MASS = 0x1 , CM_OFFSET = 0x2 , INERTIA = 0x4 , AUTO_GENERATE_ALL = MASS | CM_OFFSET | INERTIA } |
| Specifies a bit mask for controlling what should be automatically calculated when a body/geometry is changed. More... | |
Public Member Functions | |
| MassProperties (agx::Physics::RigidBodyPtr entity) | |
| Constructor (for internal use) which associates this object to the storage for a RigidBody. | |
| virtual | ~MassProperties () |
| Destructor. | |
| agx::UInt32 | getAutoGenerateMask () const |
| const SPDMatrix3x3 & | getEffectiveInertiaTensor () const |
| SPDMatrix3x3 | getEffectiveInvMassMatrix () const |
| Vec3 | getEffectiveInvMassVector () const |
| const Vec3 & | getEffectiveMass () const |
| const Vec3 & | getEffectiveMassTransformDiagonal () const |
| const SPDMatrix3x3 & | getInertiaTensor () const |
| const Vec3 & | getInertiaTensorCoefficients () const |
| const Real & | getInvMass () const |
| SPDMatrix3x3 | getInvMassMatrix () const |
| Vec3 | getInvMassVector () const |
| Real | getMass () const |
| const Vec3 & | getMassCoefficients () const |
| Vec3 | getPrincipalInertiae () const |
| MassProperties & | operator= (const MassProperties ©) |
| Assignment operator. | |
| void | setAutoGenerateMask (uint32_t mask) |
| Specify which parameters should be automatically calculated from the geometries of the body given a bitmask of AutoGenerateFlags. | |
| void | setEffectiveMassTransformDiagonal (const Vec3 &effectiveMassTransformDiagonal) |
| Set the transform to transform the effective coefficients to the body/mass frame. | |
| bool | setInertiaTensor (const SPDMatrix3x3 &m, bool autoGenerate=false) |
| Set the inertia tensor as a full 3x3 tensor matrix. | |
| bool | setInertiaTensor (const Vec3 &inertiaDiagonal, bool autoGenerate=false) |
| Set the inertia tensor given the diagonal. | |
| bool | setInertiaTensorCoefficients (const Vec3 &coefficients) |
| Set inertia tensor coefficients. | |
| bool | setMass (Real m, bool autoGenerate=false) |
| Set the mass. | |
| bool | setMassCoefficients (const Vec3 &coefficients) |
| Set mass coefficients. | |
Public Member Functions inherited from agxStream::Serializable | |
| virtual | ~Serializable () |
| Destructor for normal C++ use but hidden from SWIG bindings. | |
| virtual const char * | getClassName () const |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. | |
| virtual StorageAgent * | getStorageAgent () const =0 |
| agx::Uuid | getUuid () const |
| bool | isFinished () const |
| void | setEnableSerialization (bool flag) |
| Set to false to disable serialization of this object. | |
| void | setFinished () |
| Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. | |
Additional Inherited Members | |
Static Public Member Functions inherited from agxStream::Serializable | |
| static void | setEnableUuidGeneration (bool flag) |
| Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. | |
Protected Member Functions inherited from agxStream::Serializable | |
| Serializable () | |
| Default constructor. | |
| Serializable (const Serializable &other) | |
| Copy constructor. | |
| void | generateUuid () |
Class for rigid body inertia tensor and mass.
The mass properties is a combined object which includes the mass and the inertia tensor (in body reference frame).
In some situations the effective mass of the body may differ from the normal mass which can be controlled with the setEffective* methods.
Definition at line 39 of file MassProperties.h.
Specifies a bit mask for controlling what should be automatically calculated when a body/geometry is changed.
Definition at line 47 of file MassProperties.h.
| agx::MassProperties::MassProperties | ( | agx::Physics::RigidBodyPtr | entity | ) |
Constructor (for internal use) which associates this object to the storage for a RigidBody.
|
virtual |
Destructor.
|
inline |
Definition at line 302 of file MassProperties.h.
|
inline |
Definition at line 313 of file MassProperties.h.
References agxAssert.
| SPDMatrix3x3 agx::MassProperties::getEffectiveInvMassMatrix | ( | ) | const |
| Vec3 agx::MassProperties::getEffectiveInvMassVector | ( | ) | const |
|
inline |
|
inline |
Definition at line 319 of file MassProperties.h.
References agxAssert.
|
inline |
|
inline |
Definition at line 296 of file MassProperties.h.
References agxAssert.
|
inline |
|
inline |
Definition at line 344 of file MassProperties.h.
References agxAssert.
|
inline |
Definition at line 338 of file MassProperties.h.
References agxAssert.
|
inline |
|
inline |
Definition at line 290 of file MassProperties.h.
References agxAssert.
|
inline |
Definition at line 326 of file MassProperties.h.
References agxAssert.
| MassProperties & agx::MassProperties::operator= | ( | const MassProperties & | copy | ) |
Assignment operator.
| void agx::MassProperties::setAutoGenerateMask | ( | uint32_t | mask | ) |
Specify which parameters should be automatically calculated from the geometries of the body given a bitmask of AutoGenerateFlags.
Default is AUTO_GENERATE_ALL, which mean that all mass properties are updated whenever a geometry associated to a body is changed/removed/added.
| void agx::MassProperties::setEffectiveMassTransformDiagonal | ( | const Vec3 & | effectiveMassTransformDiagonal | ) |
Set the transform to transform the effective coefficients to the body/mass frame.
For example if the mass coefficients are given in a left handed body attached frame the effective mass transform should be: 1 0 0 0 -1 0 0 0 1
| bool agx::MassProperties::setInertiaTensor | ( | const SPDMatrix3x3 & | m, |
| bool | autoGenerate = false |
||
| ) |
Set the inertia tensor as a full 3x3 tensor matrix.
If autoGenerate is set to true, the tensor will be recalculated when the geometry configuration of the body changes.
| m | - The new inertia tensor. Should be a valid finite symmetric positive definite matrix (check its isValid()-method). |
| autoGenerate | - if true, the setAutoGenerateMask will enable the INERTIA update flag. |
| Was | setting the inertia tensor valid? |
| bool agx::MassProperties::setInertiaTensor | ( | const Vec3 & | inertiaDiagonal, |
| bool | autoGenerate = false |
||
| ) |
Set the inertia tensor given the diagonal.
If autoGenerate is set to true, the tensor will be recalculated when the geometry configuration of the body changes.
| inertiaDiagonal | - The new inertia tensor diagonal. Each component has to be > DBL_EPSILON and finite. |
| autoGenerate | - if true, the setAutoGenerateMask will enable the INERTIA update flag. |
| Was | setting the inertia tensor valid? |
| bool agx::MassProperties::setInertiaTensorCoefficients | ( | const Vec3 & | coefficients | ) |
Set inertia tensor coefficients.
Default is 0,0,0 Side effect: will also update the effective inertia. The inertia tensor coefficients can be used to change the inertia used in the RHS in the solver.
This allows for different inertia for the 3 rotational DOF of a body.
| coefficients | All coefficients have to be >= 0 and finite. |
| Could | the coefficients be set successfully? |
| bool agx::MassProperties::setMass | ( | Real | m, |
| bool | autoGenerate = false |
||
| ) |
Set the mass.
This will automatically scale the inertia matrix to reflect the change of mass.
If autoGenerate is set to true, the mass will be recalculated when the geometry configuration of the body changes.
| m | - The new mass. Has to be > DBL_EPSILON and finite. |
| autoGenerate | - if true, the setAutoGenerateMask will enable the MASS update flag. |
| Was | the mass correctly set? |
| bool agx::MassProperties::setMassCoefficients | ( | const Vec3 & | coefficients | ) |
Set mass coefficients.
Default is 0,0,0 Side effect: will also update the effective mass. The mass coefficients can be used to change the mass used in the RHS in the solver. It will not change the gravitational mass.
| coefficients | All coefficients have to be >= 0 and finite. This allows for different masses along the 3 translational DOF of a body. |
| Could | the coefficients be set successfully? |