Mathematical representation of a box which can be arbitrarily positioned and rotated. More...
#include <OrientedBox.hh>
Public Member Functions | |
OrientedBox () | |
Default constructor. More... | |
OrientedBox (const OrientedBox< T > &_b)=default | |
Copy constructor. More... | |
OrientedBox (const Vector3< T > &_size) | |
Constructor which takes only the size. More... | |
OrientedBox (const Vector3< T > &_size, const Material &_mat) | |
Constructor which takes only the size. More... | |
OrientedBox (const Vector3< T > &_size, const Pose3< T > &_pose) | |
Constructor which takes size and pose. More... | |
OrientedBox (const Vector3< T > &_size, const Pose3< T > &_pose, const Material &_mat) | |
Constructor which takes size, pose, and material. More... | |
~OrientedBox ()=default | |
Destructor. More... | |
bool | Contains (const Vector3d &_p) const |
Check if a point lies inside the box. More... | |
T | DensityFromMass (const T _mass) const |
Compute the box's density given a mass value. The box is assumed to be solid with uniform density. This function requires the box's size to be set to values greater than zero. The Material of the box is ignored. More... | |
bool | MassMatrix (MassMatrix3< T > &_massMat) const |
Get the mass matrix for this box. This function is only meaningful if the box's size and material have been set. More... | |
const Material & | Material () const |
Get the material associated with this box. More... | |
bool | operator!= (const OrientedBox< T > &_b) const |
Inequality test operator. More... | |
OrientedBox & | operator= (const OrientedBox< T > &_b)=default |
Assignment operator. Set this box to the parameter. More... | |
bool | operator== (const OrientedBox< T > &_b) const |
Equality test operator. More... | |
const Pose3< T > & | Pose () const |
Get the box pose, which is the pose of its center. More... | |
void | Pose (const Pose3< T > &_pose) |
Set the box pose. More... | |
bool | SetDensityFromMass (const T _mass) |
Set the density of this box based on a mass value. Density is computed using double DensityFromMass(const double _mass) const. The box is assumed to be solid with uniform density. This function requires the box's size to be set to values greater than zero. The existing Material density value is overwritten only if the return value from this true. More... | |
void | SetMaterial (const Material &_mat) |
Set the material associated with this box. More... | |
const Vector3< T > & | Size () const |
Get the size of the box. More... | |
void | Size (const Vector3< T > &_size) |
Set the box size. More... | |
T | Volume () const |
Get the volume of the box in m^3. More... | |
T | XLength () const |
Get the length along the x dimension. More... | |
T | YLength () const |
Get the length along the y dimension. More... | |
T | ZLength () const |
Get the length along the z dimension. More... | |
Detailed Description
template<typename T>
class gz::math::OrientedBox< T >
Mathematical representation of a box which can be arbitrarily positioned and rotated.
Constructor & Destructor Documentation
◆ OrientedBox() [1/6]
|
inline |
Default constructor.
◆ OrientedBox() [2/6]
|
inline |
◆ OrientedBox() [3/6]
|
inline |
◆ OrientedBox() [4/6]
|
inlineexplicit |
Constructor which takes only the size.
- Parameters
-
[in] _size Box size, in its own coordinate frame. Its absolute value will be taken, so the size is non-negative.
◆ OrientedBox() [5/6]
|
inlineexplicit |
◆ OrientedBox() [6/6]
|
default |
Copy constructor.
- Parameters
-
[in] _b OrientedBox to copy.
◆ ~OrientedBox()
|
default |
Destructor.
Member Function Documentation
◆ Contains()
|
inline |
Check if a point lies inside the box.
- Parameters
-
[in] _p Point to check.
- Returns
- True if the point is inside the box.
References Matrix4< T >::Inverse(), and Vector3< T >::X().
◆ DensityFromMass()
|
inline |
Compute the box's density given a mass value. The box is assumed to be solid with uniform density. This function requires the box's size to be set to values greater than zero. The Material of the box is ignored.
- Parameters
-
[in] _mass Mass of the box, in kg. This value should be greater than zero.
- Returns
- Density of the box in kg/m^3. A negative value is returned if the size or _mass is <= 0.
References OrientedBox< T >::Volume().
Referenced by OrientedBox< T >::SetDensityFromMass().
◆ MassMatrix()
|
inline |
Get the mass matrix for this box. This function is only meaningful if the box's size and material have been set.
- Parameters
-
[out] _massMat The computed mass matrix will be stored here.
- Returns
- False if computation of the mass matrix failed, which could be due to an invalid size (<=0) or density (<=0).
References MassMatrix3< T >::SetFromBox().
◆ Material()
Get the material associated with this box.
- Returns
- The material assigned to this box.
◆ operator!=()
|
inline |
◆ operator=()
|
default |
Assignment operator. Set this box to the parameter.
- Parameters
-
[in] _b OrientedBox to copy
- Returns
- The new box.
◆ operator==()
|
inline |
◆ Pose() [1/2]
|
inline |
Get the box pose, which is the pose of its center.
- Returns
- The pose of the box.
◆ Pose() [2/2]
◆ SetDensityFromMass()
|
inline |
Set the density of this box based on a mass value. Density is computed using double DensityFromMass(const double _mass) const. The box is assumed to be solid with uniform density. This function requires the box's size to be set to values greater than zero. The existing Material density value is overwritten only if the return value from this true.
- Parameters
-
[in] _mass Mass of the box, in kg. This value should be greater than zero.
- Returns
- True if the density was set. False is returned if the box's size or the _mass value are <= 0.
- See also
- double DensityFromMass(const double _mass) const
References OrientedBox< T >::DensityFromMass(), and Material::SetDensity().
◆ SetMaterial()
|
inline |
Set the material associated with this box.
- Parameters
-
[in] _mat The material assigned to this box.
◆ Size() [1/2]
|
inline |
Get the size of the box.
- Returns
- Size of the box
◆ Size() [2/2]
|
inline |
Set the box size.
- Parameters
-
[in] _size Box size, in its own coordinate frame. Its absolute value will be taken, so the size is non-negative.
References Vector3< T >::Abs().
◆ Volume()
|
inline |
Get the volume of the box in m^3.
- Returns
- Volume of the box in m^3.
Referenced by OrientedBox< T >::DensityFromMass().
◆ XLength()
|
inline |
Get the length along the x dimension.
- Returns
- Value of the length in the x dimension
◆ YLength()
|
inline |
Get the length along the y dimension.
- Returns
- Value of the length in the y dimension
◆ ZLength()
|
inline |
Get the length along the z dimension.
- Returns
- Value of the length in the z dimension
The documentation for this class was generated from the following file: