|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
#include <GREM/physics/Shape.hpp>
Public Member Functions | |
| 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. | |
| GREM_ALWAYS_INLINE 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. | |
| GREM_ALWAYS_INLINE bool | containsLocalPoint (Length< N > localPoint) const |
| Check if a local point relative to the origin of the shape is contained within the shape. | |
| GREM_ALWAYS_INLINE Length< N > | getLocalSupportPointOffset (Direction< N > localDirection) const |
| Get the local offset from the origin of the shape to the farthest point on the shape in a certain local direction. | |
| ConvexPolytopeVertexIndex | getLocalSupportPointVertexIndex (Direction< N > localDirection, ConvexPolytopeVertexIndex searchStartVertexIndex) const |
| Get the vertex index of the farthest point on the shape in a certain local direction. | |
| GREM_ALWAYS_INLINE ConvexPolytopeVertexIndex | getVertexCount () const |
| Get the total number of vertices in the convex polytope defined by this shape. | |
| GREM_ALWAYS_INLINE ConvexPolytopeFaceIndex | getFaceCount () const |
| Get the total number of faces on the convex polytope defined by this shape. | |
| GREM_ALWAYS_INLINE ConvexPolytopeEdgeIndex | getEdgeCount () const |
| Get the total number of edges, including twin edges, on the convex polyhedron defined by this 3-dimensional shape. | |
| Length< N > | getLocalVertexOffset (ConvexPolytopeVertexIndex vertexIndex) const |
| Get the local offset of a specific vertex in the convex polytope defined by this shape. | |
| Length< N > | getLocalFaceOffset (ConvexPolytopeFaceIndex faceIndex) const |
| Get the local offset of a specific face on the convex polytope defined by this shape. | |
| Direction< N > | getLocalFaceNormal (ConvexPolytopeFaceIndex faceIndex) const |
| Get the local normal of a specific face on the convex polytope defined by this shape. | |
| ConvexPolytopeFaceIndex | getFaceIndexWithMostFittingLocalNormal (Direction< N > localDirection, ConvexPolytopeFaceIndex searchStartFaceIndex) const |
| Get the index of the face on the convex polytope defined by this shape whose local normal is the most parallel with a given local direction. | |
| ConvexPolytopeVertexIndex | getFirstVertexIndexOfEdge (ConvexPolytopeEdgeIndex edgeIndex) const |
| Get the vertex index of the first point of a specific edge on the convex polyhedron defined by this 3-dimensional shape. | |
| ConvexPolytopeFaceIndex | getFaceIndexOfEdge (ConvexPolytopeEdgeIndex edgeIndex) const |
| Get the index of the face that a specific edge is part of on the convex polyhedron defined by this 3-dimensional shape. | |
| ConvexPolytopeEdgeIndex | getNextEdgeIndex (ConvexPolytopeEdgeIndex edgeIndex) const |
| Get the index of the next edge after another edge on the same face on the convex polyhedron defined by this 3-dimensional shape, which will eventually loop back around to the given edge again. | |
| ConvexPolytopeEdgeIndex | getFirstEdgeIndexOfFace (ConvexPolytopeFaceIndex faceIndex) const |
| Get the index of the first edge that a specific face is made up of on the convex polyhedron defined by this 3-dimensional shape. | |
| ConvexPolytopeEdgeIndex | getSomeEdgeIndexOfVertex (ConvexPolytopeVertexIndex vertexIndex) const |
| Get the index of some edge that has a specific vertex as its origin on the convex polyhedron defined by this 3-dimensional shape. | |
Public Attributes | |
| Length< N > | halfExtents |
| Shortest lengths from the center of the box to its side along each local axis. Must be positive. | |
Box shape.
| N | number of dimensions of the world space (must be 2 or 3). |
|
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. |
|
inlinenodiscard |
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. |
|
inlinenodiscard |
Check if a local point relative to the origin of the shape is contained within the shape.
| localPoint | point in shape-local space to check. |
| BadVariantAccess | if the underlying shape type is not convex. |
|
inlinenodiscard |
Get the local offset from the origin of the shape to the farthest point on the shape in a certain local direction.
| localDirection | unit vector in shape-local space of the direction to evaluate. Must be a unit vector. |
| BadVariantAccess | if the underlying shape type is not convex. |
|
nodiscard |
Get the vertex index of the farthest point on the shape in a certain local direction.
| localDirection | unit vector in shape-local space of the direction to evaluate. Must be a unit vector. |
| searchStartVertexIndex | initial vertex index to start the search from. Must either be 0, or less than getVertexCount(). |
| BadVariantAccess | if the underlying shape type is not a convex polytope. |
|
inlinenodiscard |
Get the total number of vertices in the convex polytope defined by this shape.
| BadVariantAccess | if the underlying shape type is not a convex polytope. |
|
inlinenodiscard |
Get the total number of faces on the convex polytope defined by this shape.
| BadVariantAccess | if the underlying shape type is not a convex polytope. |
|
inlinenodiscard |
Get the total number of edges, including twin edges, on the convex polyhedron defined by this 3-dimensional shape.
| BadVariantAccess | if the underlying shape type is not a convex polytope. |
|
nodiscard |
Get the local offset of a specific vertex in the convex polytope defined by this shape.
| vertexIndex | index of the vertex to get the offset of. |
| BadVariantAccess | if the underlying shape type is not a convex polytope. |
|
nodiscard |
Get the local offset of a specific face on the convex polytope defined by this shape.
| faceIndex | index of the face to get the offset of. |
| BadVariantAccess | if the underlying shape type is not a convex polytope. |
|
nodiscard |
Get the local normal of a specific face on the convex polytope defined by this shape.
| faceIndex | index of the face to get the normal of. |
| BadVariantAccess | if the underlying shape type is not a convex polytope. |
|
nodiscard |
Get the index of the face on the convex polytope defined by this shape whose local normal is the most parallel with a given local direction.
| localDirection | unit direction vector to search in, in object space. Must be a unit vector. |
| searchStartFaceIndex | initial face index to start the search from. Must either be 0, or less than getFaceCount(). |
| BadVariantAccess | if the underlying shape type is not a convex polytope. |
|
nodiscard |
Get the vertex index of the first point of a specific edge on the convex polyhedron defined by this 3-dimensional shape.
| edgeIndex | index of the edge whose vertex index to get. |
| BadVariantAccess | if the underlying shape type is not a convex polytope. |
|
nodiscard |
Get the index of the face that a specific edge is part of on the convex polyhedron defined by this 3-dimensional shape.
| edgeIndex | index of the edge to get the face index of. |
| BadVariantAccess | if the underlying shape type is not a convex polytope. |
|
nodiscard |
Get the index of the next edge after another edge on the same face on the convex polyhedron defined by this 3-dimensional shape, which will eventually loop back around to the given edge again.
The winding order is counter-clockwise when viewed from outside of the shape.
| edgeIndex | index of the edge to get the next edge index of. |
| BadVariantAccess | if the underlying shape type is not a convex polytope. |
|
nodiscard |
Get the index of the first edge that a specific face is made up of on the convex polyhedron defined by this 3-dimensional shape.
| faceIndex | index of the face to get the first edge index of. |
| BadVariantAccess | if the underlying shape type is not a convex polytope. |
|
nodiscard |
Get the index of some edge that has a specific vertex as its origin on the convex polyhedron defined by this 3-dimensional shape.
| vertexIndex | index of the vertex to get the edge index of. |
| BadVariantAccess | if the underlying shape type is not a convex polytope. |
| Length<N> grem::physics::BoxShape< N >::halfExtents |
Shortest lengths from the center of the box to its side along each local axis. Must be positive.