gz/math/Capsule.hh
Go to the documentation of this file.
A representation of a capsule or sphere-capped cylinder.
Definition: gz/math/Capsule.hh:45
const Material & Mat() const
Get the material associated with this capsule.
std::optional< Vector3< Precision > > CenterOfVolumeBelow(const Plane< Precision > &_plane) const
Center of volume below the plane. This is useful for example when calculating where buoyancy should b...
bool SetDensityFromMass(const Precision _mass)
Set the density of this capsule based on a mass value. Density is computed using Precision DensityFro...
Precision DensityFromMass(const Precision _mass) const
Compute the capsule's density given a mass value. The capsule is assumed to be solid with uniform den...
Capsule(const Precision _length, const Precision _radius)
Construct a capsule with a length and radius.
bool operator==(const Capsule &_capsule) const
Check if this capsule is equal to the provided capsule. Radius, length, and material properties will ...
Capsule(const Precision _length, const Precision _radius, const Material &_mat)
Construct a capsule with a length, radius, and material.
Precision VolumeBelow(const Plane< Precision > &_plane) const
Get the volume of the capsule below a given plane in m^3. It is assumed that the center of the capsul...
Capsule()=default
Default constructor. The default radius and length are both zero.
void SetMat(const Material &_mat)
Set the material associated with this capsule.
std::optional< MassMatrix3< Precision > > MassMatrix() const
Get the mass matrix for this capsule. This function is only meaningful if the capsule's radius,...
Contains information about a single material.
Definition: gz/math/Material.hh:66
Capsule< float > Capsulef
Capsule with float precision.
Definition: gz/math/Capsule.hh:163
Capsule< int > Capsulei
Capsule with integer precision.
Definition: gz/math/Capsule.hh:155
Capsule< double > Capsuled
Capsule with double precision.
Definition: gz/math/Capsule.hh:159
Definition: gz/math/AdditivelySeparableScalarField3.hh:28