Conical frustum shape aligned with the local Y axis in 3-dimensional space.
More...
#include <GREM/physics/Shape.hpp>
|
| Distance | bottomRadius |
| | Radius of the bottom (-Y) disc of the conical frustum. Must be non-negative. Must be positive if topRadius is 0.
|
| Distance | topRadius |
| | Radius of the top (+Y) disc of the conical frustum. Must be non-negative. Must be positive if bottomRadius is 0.
|
| Distance | halfLength |
| | Half of the length of the conical frustum's center line along its local Y axis. Must be positive.
|
Conical frustum shape aligned with the local Y axis in 3-dimensional space.
◆ calculateVolume()
| Volume grem::physics::TaperedCylinderShape3D::calculateVolume |
( |
| ) |
const |
|
nodiscard |
Calculate an estimate of the volume of the shape.
- Returns
- the estimated volume of the shape.
◆ calculatePrincipalMomentsOfInertia()
Calculate an estimate of the local moment of inertia of the shape given a certain mass.
- Parameters
-
| mass | assumed mass of the shape. |
- Returns
- the estimated moment of inertia in shape-local space.
◆ getBoundingBox()
Get the axis-aligned bounding box of the shape given its position and orientation in the world.
- Parameters
-
| transformation | transformation of the shape in world space. |
- Returns
- an axis-aligned bounding box in world space that would contain the entire shape if the shape was at the given position and orientation in the world, or an empty optional if the shape extends infinitely and cannot be fit inside a finite box.
◆ getBoundingRadius()
Get the radius of the bounding sphere of the shape.
- Parameters
-
| basis | transformation basis of the shape in world space. |
- Returns
- the maximum distance from the origin of any point on the shape, or an empty optional if the shape extends infinitely and cannot be fit inside a finite sphere.
◆ getReferenceArea()
Get an estimate of the reference area of the shape for a certain direction, typically calculated as the area of the largest cross section orthogonal to the given direction.
- Parameters
-
| basis | transformation basis of the shape in world space. |
| direction | direction to get the reference area for. |
- Returns
- the reference area, or an empty optional if an area cannot be determined, e.g. because the shape is infinite.
◆ castLocalRay()
Find the closest intersection of this shape with a given ray in local space.
- Parameters
-
| localRayOrigin | offset of the ray origin in shape-local space. |
| localRayDirection | unit direction vector of the ray in shape-local space. Must be a unit vector. |
| maxLocalRayDistance | maximum hit distance of the ray in shape-local space. Must be non-negative. |
- Returns
- the result of the raycast.
◆ containsLocalPoint()
| bool grem::physics::TaperedCylinderShape3D::containsLocalPoint |
( |
Length3D | localPoint | ) |
const |
|
nodiscard |
Check if a local point relative to the origin of the shape is contained within the shape.
- Parameters
-
| localPoint | point in shape-local space to check. |
- Returns
- true if the shape contains the given point, false otherwise.
- Exceptions
-
◆ getLocalSupportPointOffset()
| Length3D grem::physics::TaperedCylinderShape3D::getLocalSupportPointOffset |
( |
Direction3D | localDirection | ) |
const |
|
nodiscard |
Get the local offset from the origin of the shape to the farthest point on the shape in a certain local direction.
- Parameters
-
| localDirection | unit vector in shape-local space of the direction to evaluate. Must be a unit vector. |
- Returns
- a relative vector from the origin of the shape to the farthest point on the shape in the given direction, in shape-local space.
- Exceptions
-
◆ bottomRadius
| Distance grem::physics::TaperedCylinderShape3D::bottomRadius |
Radius of the bottom (-Y) disc of the conical frustum. Must be non-negative. Must be positive if topRadius is 0.
◆ topRadius
| Distance grem::physics::TaperedCylinderShape3D::topRadius |
Radius of the top (+Y) disc of the conical frustum. Must be non-negative. Must be positive if bottomRadius is 0.
◆ halfLength
| Distance grem::physics::TaperedCylinderShape3D::halfLength |
Half of the length of the conical frustum's center line along its local Y axis. Must be positive.
The documentation for this struct was generated from the following file: