|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Shape that combines multiple colliders. More...
#include <GREM/physics/Shape.hpp>
Public Member Functions | |
| GREM_ALWAYS_INLINE | CompoundColliderShape (SharedPointer< SubCollider< N >[]> subColliders) noexcept |
| Construct a compound collider shape from a set of colliders. | |
| CompoundColliderShape (Span< const SubCollider< N > > subColliders) | |
| Construct a compound shape from a set of colliders. | |
| GREM_ALWAYS_INLINE Span< const SubCollider< N > > | getSubColliders () const noexcept |
| Get the underlying set of colliders of this compound collider shape. | |
| Volume | calculateVolume () const |
| Calculate an estimate of the volume of the shape. | |
| PrincipalMomentsOfInertia< N > | calculatePrincipalMomentsOfInertia (Mass mass) const |
| Calculate an estimate of the local moment of inertia of the shape given a certain mass. | |
| GREM_ALWAYS_INLINE Optional< Box< N > > | getBoundingBox (const Transformation< N > &transformation) const |
| Get the axis-aligned bounding box of the shape given its position and orientation in the world. | |
| GREM_ALWAYS_INLINE Optional< Distance > | getBoundingRadius (const Basis< N > &basis) const |
| Get the radius of the bounding sphere of the shape. | |
| Optional< Area > | getReferenceArea (const Basis< N > &basis, Direction< N > direction) const |
| 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. | |
| RaycastResult< N > | castLocalRay (Length< N > localRayOrigin, Direction< N > localRayDirection, Distance maxLocalRayDistance) const |
| Find the closest intersection of this shape with a given ray in local space. | |
Shape that combines multiple colliders.
| N | number of dimensions of the world space (must be 2 or 3). |
|
inlineexplicitnoexcept |
Construct a compound collider shape from a set of colliders.
| subColliders | shared pointer to the colliders. Must not be nullptr. |
|
explicit |
Construct a compound shape from a set of colliders.
| subColliders | colliders to construct the compound shape from. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenodiscardnoexcept |
Get the underlying set of colliders of this compound collider shape.
|
nodiscard |
Calculate an estimate of the volume of the shape.
|
nodiscard |
Calculate an estimate of the local moment of inertia of the shape given a certain mass.
| mass | assumed mass of the shape. |
|
inlinenodiscard |
Get the axis-aligned bounding box of the shape given its position and orientation in the world.
| transformation | transformation of the shape in world space. |
|
inlinenodiscard |
Get the radius of the bounding sphere of the shape.
| basis | transformation basis of the shape in world space. |
|
nodiscard |
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.
| basis | transformation basis of the shape in world space. |
| direction | direction to get the reference area for. |
|
nodiscard |
Find the closest intersection of this shape with a given ray in local space.
| 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. |