Utility class to compute and manipulate mass and inertia tensor properties.
More...
#include <PxMassProperties.h>
|
|
PxMat33 | inertiaTensor |
| | The inertia tensor of the object.
|
| |
|
PxVec3 | centerOfMass |
| | The center of mass of the object.
|
| |
|
PxReal | mass |
| | The mass of the object.
|
| |
Utility class to compute and manipulate mass and inertia tensor properties.
In most cases PxRigidBodyExt::updateMassAndInertia(), PxRigidBodyExt::setMassAndUpdateInertia() should be enough to setup the mass properties of a rigid body. This utility class targets users that need to customize the mass properties computation.
◆ PxMassProperties()
| physx::PxMassProperties::PxMassProperties |
( |
const PxGeometry & |
geometry | ) |
|
|
inline |
Compute mass properties based on a provided geometry structure.
This constructor assumes the geometry has a density of 1. Mass and inertia tensor scale linearly with density.
- Parameters
-
| [in] | geometry | The geometry to compute the mass properties for. Supported geometry types are: sphere, box, capsule and convex mesh. |
◆ getMassSpaceInertia()
Get the entries of the diagonalized inertia tensor and the corresponding reference rotation.
- Parameters
-
| [in] | inertia | The inertia tensor to diagonalize. |
| [out] | massFrame | The frame the diagonalized tensor refers to. |
- Returns
- The entries of the diagonalized inertia tensor.
◆ operator*()
Scale mass properties.
- Parameters
-
| [in] | scale | The linear scaling factor to apply to the mass properties. |
- Returns
- The scaled mass properties.
◆ rotateInertia()
Rotate an inertia tensor around the center of mass.
- Parameters
-
| [in] | inertia | The inertia tensor to rotate. |
| [in] | q | The rotation from the new to the old coordinate frame, i.e. q.rotate(v) transforms the coordinates of vector v from the old to the new coordinate frame. |
- Returns
- The rotated inertia tensor.
◆ scaleInertia()
| static PxMat33 physx::PxMassProperties::scaleInertia |
( |
const PxMat33 & |
inertia, |
|
|
const PxQuat & |
scaleRotation, |
|
|
const PxVec3 & |
scale |
|
) |
| |
|
inlinestatic |
Non-uniform scaling of the inertia tensor.
- Parameters
-
| [in] | inertia | The inertia tensor to scale. |
| [in] | scaleRotation | The rotation from the scaling frame to the frame that inertia is expressed in. I.e. scaleRotation.rotate(v) transforms the coordinates of vertex v from inertia's frame to the scaling-axes frame. |
| [in] | scale | The scaling factor for each axis (relative to the frame specified with scaleRotation). |
- Returns
- The scaled inertia tensor.
◆ sum()
Sum up individual mass properties.
- Parameters
-
| [in] | props | Array of mass properties to sum up. |
| [in] | transforms | Reference transforms for each mass properties entry. |
| [in] | count | The number of mass properties to sum up. |
- Returns
- The summed up mass properties.
◆ translate()
Translate the center of mass by a given vector and adjust the inertia tensor accordingly.
- Parameters
-
| [in] | t | The translation vector for the center of mass. |
◆ translateInertia()
Translate an inertia tensor using the parallel axis theorem.
- Parameters
-
| [in] | inertia | The inertia tensor to translate. |
| [in] | mass | The mass of the object. |
| [in] | t | The relative frame to translate the inertia tensor to. |
- Returns
- The translated inertia tensor.
The documentation for this class was generated from the following file: