11#ifndef TOYMAKERENGINE_SPATIALQUERYTYPES_H
12#define TOYMAKERENGINE_SPATIALQUERYTYPES_H
19#include <glm/gtc/quaternion.hpp>
20#include <nlohmann/json.hpp>
26 inline float squareDistance(
const glm::vec3& vector) {
27 return glm::dot(vector, vector);
58 return std::isfinite(number);
69 inline bool isFinite(
const glm::vec3& vector) {
96 inline bool isNumber(
float number) {
97 return !std::isnan(number);
100 inline bool isNumber(
const glm::vec3& vector) {
101 return isNumber(vector.x) && isNumber(vector.y) && isNumber(vector.z);
113 return number >= 0.f;
129 template <
typename TDerived>
157 std::array<glm::vec3, 8> cornerSigns {};
158 for(
BoxCorner corner {0}; corner < 8; ++corner) {
159 cornerSigns[corner].x = corner&BoxCornerSpecifier::RIGHT? 1.f: -1.f;
160 cornerSigns[corner].y = corner&BoxCornerSpecifier::TOP? 1.f: -1.f;
161 cornerSigns[corner].z = corner&BoxCornerSpecifier::FRONT? 1.f: -1.f;
174 glm::vec3 absoluteCornerOffset { .5f * boxDimensions };
175 std::array<glm::vec3, 8> cornerArray { .5f * boxDimensions };
176 for(uint8_t corner{0}; corner < 8; ++corner) {
177 cornerArray[corner] = cornerSignsArray[corner] * absoluteCornerOffset;
191 template <
typename TDerived>
206 template <
typename TDerived>
219 template <
typename TDerived>
226 template <
typename TDerived>
235 return TDerived::getVolumeRelativeBoxCorners();
245 return TDerived::isSensible();
255 return TDerived::isPositiveStrict();
428 glm::length(glm::cross(
545 float mLength { std::numeric_limits<float>::infinity() };
662 inline bool append(
const glm::vec3& candidatePoint,
const glm::vec3& supportA,
const glm::vec3& supportB) {
663 assert(
mNPoints < 4 &&
"We already have 4 (or more) points, there's no more needed");
664 assert(supportA - supportB == candidatePoint &&
"The difference in supports should yield the candidate point");
678 inline void reorder(
const std::vector<uint8_t> reorderedIndices) {
679 assert(reorderedIndices.size() <= 4 &&
"Invalid point list provided");
680 const std::array<glm::vec3, 4> oldPoints {
mPoints };
684 for(
const auto& index: reorderedIndices) {
685 const bool pointAddedSuccessfully{
append(oldPoints[index], oldPointsSupportA[index], oldPointsSupportB[index]) };
686 assert(pointAddedSuccessfully &&
"Invalid point list provided");
701 std::pair<bool, glm::vec3>
evaluate();
704 std::pair<bool, glm::vec3> doSimplex4();
705 glm::vec3 doSimplex3();
706 glm::vec3 doSimplex2();
723 std::array<uint16_t, 3> mIndices {};
736 std::priority_queue<Face, std::vector<Face>, std::function<bool(
const Face&,
const Face&)>>
mFaces;
754 inline glm::vec3 getTriangleCross(
const Face& face)
const {
761 inline glm::vec3 getTriangleNorm(
const Face& face)
const {
762 return glm::normalize(getTriangleCross(face));
786 std::size_t getNumPoints()
const {
841 bool append(
const glm::vec3& newPoint,
const glm::vec3& supportA,
const glm::vec3& supportB);
949 VolumeBox mBox { .mDimensions{ glm::vec3{0.f} } };
969 const glm::vec3& positionOffset,
970 const glm::quat& orientationOffset,
990 const glm::vec3& positionOffset,
991 const glm::quat& orientationOffset,
1011 const glm::vec3& positionOffset,
1012 const glm::quat& orientationOffset,
1151 { 1.f, 0.f, 0.f, 0.f },
1152 { 0.f, 1.f, 0.f, 0.f },
1153 { 0.f, 0.f, 1.f, 0.f },
1290 &&
"Invalid box parameters provided"
1293 TrueVolume { .mBox { .mDimensions { boxDimensions } } }
1304 &&
"Invalid capsule parameters provided"
1308 .mCapsule { .mHeight { height }, .mRadius { radius } }
1320 &&
"Invalid sphere parameters provided"
1324 .mSphere { .mRadius { radius } }
1455 AxisAlignedBounds operator+(
const AxisAlignedBounds& other)
const;
1462 std::array<glm::vec3, 8> getAxisAlignedBoxCorners()
const;
1476 Extents getAxisAlignedBoxExtents()
const;
1513 glm::vec3 getSupportAlong(
const glm::vec3& axis)
const;
1547 assert(
isFinite(position) &&
"Invalid position specified. Position must be finite");
1559 assert(
isNonNegative(dimensions) &&
isFinite(dimensions) &&
"Invalid dimensions provided. Dimensions must be non negative and finite");
1561 const glm::vec3 deltaDimensions { dimensions -
getDimensions() };
1562 mExtents.first += .5f * deltaDimensions;
1563 mExtents.second -= .5f * deltaDimensions;
1571 void setByExtents(
const Extents& axisAlignedExtents);
1590 NLOHMANN_JSON_SERIALIZE_ENUM( ObjectBounds::TrueVolumeType, {
1591 {ObjectBounds::TrueVolumeType::BOX,
"box"},
1592 {ObjectBounds::TrueVolumeType::SPHERE,
"sphere"},
1593 {ObjectBounds::TrueVolumeType::CAPSULE,
"capsule"},
1600 inline void to_json(nlohmann::json& json,
const ObjectBounds& objectBounds) {
1602 {
"type", ObjectBounds::getComponentTypeName()},
1603 {
"volume_type", objectBounds.mType},
1604 {
"position_offset", { objectBounds.mPositionOffset.x, objectBounds.mPositionOffset.y, objectBounds.mPositionOffset.z}},
1605 {
"orientation_offset", { objectBounds.mOrientationOffset.w, objectBounds.mOrientationOffset.x, objectBounds.mOrientationOffset.y, objectBounds.mOrientationOffset.z }},
1607 switch(objectBounds.mType) {
1608 case ObjectBounds::TrueVolumeType::BOX:
1609 json[
"volume_properties"] = {
1610 {
"width", objectBounds.mTrueVolume.mBox.mDimensions.x},
1611 {
"height", objectBounds.mTrueVolume.mBox.mDimensions.y},
1612 {
"depth", objectBounds.mTrueVolume.mBox.mDimensions.z},
1615 case ObjectBounds::TrueVolumeType::SPHERE:
1616 json[
"volume_properties"] = {
1617 {
"radius", objectBounds.mTrueVolume.mSphere.mRadius},
1620 case ObjectBounds::TrueVolumeType::CAPSULE:
1621 json[
"volume_properties"] = {
1622 {
"radius", objectBounds.mTrueVolume.mCapsule.mRadius},
1623 {
"height", objectBounds.mTrueVolume.mCapsule.mHeight},
1630 inline void from_json(
const nlohmann::json& json, ObjectBounds& objectBounds) {
1631 assert(json.at(
"type") == ObjectBounds::getComponentTypeName() &&
"Incorrect type property for an objectBounds component");
1632 const glm::vec3 positionOffset {
1633 json.at(
"position_offset")[0],
1634 json.at(
"position_offset")[1],
1635 json.at(
"position_offset")[2],
1637 const glm::vec3 orientationOffset {
1638 glm::eulerAngles(glm::normalize(glm::quat {
1639 json.at(
"orientation_offset")[0],
1640 json.at(
"orientation_offset")[1],
1641 json.at(
"orientation_offset")[2],
1642 json.at(
"orientation_offset")[3]
1648 switch (
static_cast<ObjectBounds::TrueVolumeType
>(json.at(
"volume_type"))) {
1649 case ObjectBounds::TrueVolumeType::BOX:
1650 objectBounds = ObjectBounds::create(
1651 VolumeBox{ .mDimensions {
1652 json.at(
"volume_properties").at(
"width").get<
float>(),
1653 json.at(
"volume_properties").at(
"height").get<
float>(),
1654 json.at(
"volume_properties").at(
"depth").get<
float>(),
1663 case ObjectBounds::TrueVolumeType::SPHERE:
1664 objectBounds = ObjectBounds::create(
1665 VolumeSphere { .mRadius { json.at(
"volume_properties").at(
"radius").get<
float>() } },
1673 case ObjectBounds::TrueVolumeType::CAPSULE:
1674 objectBounds = ObjectBounds::create(
1676 .mHeight { json.at(
"volume_properties").at(
"height").get<
float>() },
1677 .mRadius { json.at(
"volume_properties").at(
"radius").get<
float>() },
1686 objectBounds.mVolumeSystemComputed =
false;
1690 inline void to_json(nlohmann::json& json,
const AxisAlignedBounds& axisAlignedBounds) {
1692 (void)axisAlignedBounds;
1696 inline void from_json(
const nlohmann::json& json, AxisAlignedBounds& objectBounds) {
glm::vec3 getPositionWorld() const
Gets the coordinates of the center of this box.
Definition types.hpp:1490
std::array< AreaTriangle, 12 > getAxisAlignedBoxFaceTriangles() const
Gets an array of triangles in the world which make up the surface of this box.
Definition types.hpp:1469
void setPosition(const glm::vec3 &position)
Sets the position of this box.
Definition types.hpp:1546
void setDimensions(const glm::vec3 &dimensions)
Sets the dimensions of this box.
Definition types.hpp:1558
std::pair< glm::vec3, glm::vec3 > Extents
Pair where first: right top front corner; second: left back bottom corner of an AABB.
Definition types.hpp:1416
InteractionLayerMask mInteractionLayers
Determines which spatial queries and collisions this object participates in.
Definition types.hpp:1583
glm::vec3 getDimensions() const
Gets the dimensions of this box.
Definition types.hpp:1483
Extents mExtents
The pair of coordinates at the extreme corners of this box (i.e., the top-right-front and bottom-left...
Definition types.hpp:1577
std::array< glm::vec3, 8 > getAxisAlignedBoxCorners() const
Gets an array of coordinates of the corners of this box.
Definition types.cpp:417
AxisAlignedBounds()
Constructs a new empty Axis Aligned Bounds object.
Definition types.cpp:395
bool isSensible() const
Tests whether this box is sensible (it has a finite position, and finite non-negative dimensions).
Definition types.hpp:1498
bool isPositiveStrict() const
Tests whether this box has strictly positive parameters and hence encloses some region in space.
Definition types.hpp:1521
AxisAlignedBounds(const glm::vec3 &position, const glm::vec3 &dimensions, InteractionLayerMask interactionLayers=0x0)
Constructs a new Axis Aligned Bounds object based on the position of the origin and the dimensions of...
Definition types.hpp:1445
static std::string getComponentTypeName()
Gets the component type string for this object.
Definition types.hpp:1410
AreaTriangle getClosestTriangle() const
Returns the closest polytope triangle.
Definition types.cpp:105
AreaTriangle getClosestTriangleSupportB() const
Gets the points of shape B that were responsible for generating the closest triangle of the polytope.
Definition types.cpp:123
bool append(const glm::vec3 &newPoint, const glm::vec3 &supportA, const glm::vec3 &supportB)
Appends a new point, replacing the topmost triangle in the polygon with 3 more triangles including th...
Definition types.cpp:155
std::size_t getNumFaces() const
Definition types.hpp:782
std::vector< glm::vec3 > mPointsSupportA
List of points representing support point A, where each point corresponds to the polytope point it ge...
Definition types.hpp:746
glm::vec3 getClosestPoint() const
Returns the closest point to the origin on the triangle face closest to the origin.
Definition types.cpp:91
AreaTriangle getClosestTriangleSupportA() const
Gets the points of shape A that were responsible for generating the closest triangle of the polytope.
Definition types.cpp:114
Polytope()
Definition types.cpp:132
glm::vec3 getClosestTriangleNormal() const
Returns the direction to the closest point on the polytope's surface from the origin.
Definition types.cpp:97
std::vector< glm::vec3 > mPointsSupportB
List of points representing support point B, where each point corresponds to the polytope point it ge...
Definition types.hpp:752
glm::vec3 getNextSearch() const
Returns the next search direction for a point to add to the polytope.
Definition types.cpp:80
std::priority_queue< Face, std::vector< Face >, std::function< bool(const Face &, const Face &)> > mFaces
The list of triangle faces representing this polytope.
Definition types.hpp:736
std::vector< glm::vec3 > mPoints
List of points representing this polytope.
Definition types.hpp:741
bool isPositiveStrict(float number)
Tests whether a number is strictly positive.
Definition types.hpp:81
void setInteractionMask(InteractionLayerMask newMask)
Changes which set of interaction layers this object can trigger events with.
Definition types.hpp:1389
InteractionLayerMask getInteractionLayers() const
Returns an integer representing which spatial queries and collisions this object will participate in.
Definition types.hpp:1532
InteractionLayerMask getInteractionLayers() const
Returns an integer representing which spatial queries and collisions this object will participate in.
Definition types.hpp:1368
bool isPositiveStrict() const
Checks whether underlying bounds is non-trivial, as in each important parameter that represents the v...
Definition types.cpp:23
InteractionLayerMask getInteractionMask() const
Returns an integer representing which layers this object will generate spatial queries and collisions...
Definition types.hpp:1382
void setInteractionLayers(InteractionLayerMask newLayers)
Sets interaction layer mask for this object.
Definition types.hpp:1539
uint8_t BoxCorner
Type used to represent the name of the corner of a box.
Definition types.hpp:35
void setInteractionLayers(InteractionLayerMask newLayers)
Moves this object into a new group of interaction layers.
Definition types.hpp:1375
BoxCornerSpecifier
Enum values correspond to bits on a BoxCorner which help specify which side of the box on each axis i...
Definition types.hpp:42
uint16_t InteractionLayerMask
Bit field where each bit represents an interaction layer – a physics/spatial layer that can trigger o...
Definition types.hpp:138
bool isNonNegative(float number)
Tests whether a number is non-negative.
Definition types.hpp:112
std::array< AreaTriangle, 12 > computeBoxFaceTriangles(const std::array< glm::vec3, 8 > &boxCorners)
Generates a list of triangles making up the surface of a box situated somewhere in the world,...
Definition types.cpp:526
bool isFinite(float number)
Tests whether a given number is finite.
Definition types.hpp:57
Namespace containing all class definitions and functions related to the ToyMaker engine.
Definition application.hpp:25
A set of numbers representing a single circle situated somewhere in the world.
Definition types.hpp:472
glm::vec3 mCenter
The real-world coordinates of the center of the circle.
Definition types.hpp:483
glm::vec3 mNormal
A vector normal to the surface of the circle, in whose direction it may be assumed the circle is faci...
Definition types.hpp:489
bool isSensible() const
Tests whether the circle described by these parameters is valid (as opposed to invalid or infinite).
Definition types.hpp:497
bool isPositiveStrict() const
Tests whether the circle's parameters are strictly positive, and hence whether the circle encloses so...
Definition types.hpp:516
float mRadius
The radius of the circle.
Definition types.hpp:477
A set of 3 points located in the world forming a (hopefully sensible) triangle.
Definition types.hpp:408
std::array< glm::vec3, 3 > mPoints
The points of the triangle, where each point has 3 components.
Definition types.hpp:413
bool isPositiveStrict() const
Tests whether the points of this triangle encapsulate some area in space.
Definition types.hpp:443
bool isSensible() const
Tests whether the points describing the triangle are sensible (as opposed to invalid or infinite).
Definition types.hpp:422
Data representing everything about a collision.
Definition types.hpp:897
Contact mContactA
Contact information relative to the first collision shape.
Definition types.hpp:908
Contact mContactB
Contact information relative to the second collision shape.
Definition types.hpp:914
bool mCollided
Whether a collision occurred.
Definition types.hpp:902
A component defining the true bounds of a spatially queryable object situated somewhere in the world.
Definition types.hpp:926
static ObjectBounds create(const VolumeBox &box, const glm::vec3 &positionOffset, const glm::quat &orientationOffset, InteractionLayerMask interactionLayers=0x1, InteractionLayerMask interactionMask=std::numeric_limits< InteractionLayerMask >::max())
Creates bounds for an object in the shape of a box.
Definition types.cpp:41
void setVolumeBox(const glm::vec3 &boxDimensions)
Sets a box volume for this object.
Definition types.hpp:1287
TrueVolume mTrueVolume
The data defining the volume itself, independent of its position.
Definition types.hpp:1027
bool isSensible() const
Returns whether the underlying volume has sensible parameters (i.e., finite, non-degenerate,...
Definition types.cpp:326
void setVolume(TrueVolumeType type, const TrueVolume &volume)
Sets the volume for these bounds.
Definition types.hpp:1277
void setOrientationOrigin(const glm::quat &newOrientation)
Sets orientation of the scene node.
Definition types.cpp:302
static std::string getComponentTypeName()
Fetches the component type string associated with this class.
Definition types.hpp:932
std::pair< float, float > getProjectionAlong(const glm::vec3 &axis) const
Returns this shape's projection along some unit vector.
Definition types.cpp:353
bool mVolumeSystemComputed
Flag set when these object bounds were set by the engine, through light bounds compute or model bound...
Definition types.hpp:1101
void setPositionWorld(const glm::vec3 &newPosition)
Sets the new world position for the object while keeping its offset relative to its entity fixed.
Definition types.cpp:247
glm::quat mOrientationOrigin
The orientation in the real world of the origin of the scene node this bounds component is attached t...
Definition types.hpp:1057
std::array< glm::vec3, 8 > getLocalOrientedBoxCorners() const
Gets the corners of the box just encapsulating this object's true volume and sharing its position and...
Definition types.cpp:310
std::array< glm::vec3, 8 > getWorldOrientedBoxCorners() const
Gets the corners of the box just encapsulating this object's true volume relative to the origin of th...
Definition types.cpp:318
InteractionLayerMask mInteractionMask
Determines which spatial queries and collisions this object will generate.
Definition types.hpp:1075
TrueVolumeType mType
Value indicating the type of the volume represented by this object.
Definition types.hpp:1021
void applyModelMatrix(const glm::mat4 &modelMatrix)
Computes new mPosition and mOrientation offsets based on (presumably) the model transform of the unde...
Definition types.cpp:217
glm::quat mOrientationWorld
The world orientation of the bounds of this object in the current frame.
Definition types.hpp:1051
bool mTransformUpdateRequired
Flag set when object position or orientation has been set through this component, indicating that the...
Definition types.hpp:1088
glm::vec3 mPositionWorld
The world position of the bounds of this object in the current frame.
Definition types.hpp:1033
glm::quat getOrientationWorld() const
The final orientation of the object bounds in the world.
Definition types.cpp:268
InteractionLayerMask mInteractionLayers
Determines which spatial queries and collisions this object participates in.
Definition types.hpp:1069
void setPositionOrigin(const glm::vec3 &newPosition)
Sets the position of the scene node origin.
Definition types.cpp:261
glm::vec3 mPositionOrigin
The position, in the real world, of origin of the scene node this data is attached to.
Definition types.hpp:1039
glm::mat4 getTranslationTransformOrigin() const
Gets the translation matrix associated with the underlying scene object's translation.
Definition types.hpp:1149
std::array< AreaTriangle, 12 > getWorldOrientedBoxFaceTriangles() const
Gets an array of triangles that make up the faces of the bounds-aligned box corners in world space.
Definition types.hpp:1263
void setPositionOffset(const glm::vec3 &newPosition)
Sets the offset of the bounds origin to the scene node origin.
Definition types.cpp:256
glm::vec3 getSupportAlong(const glm::vec3 &axis) const
Returns the point on this object's surface furthest along a given axis from the origin of this object...
Definition types.cpp:371
void recomputeWorldPositionOrientation()
Recomputes bounds world position based on origin and offsets.
Definition types.cpp:272
void setVolumeCapsule(float radius, float height)
Sets a capsule volume for this object.
Definition types.hpp:1301
std::pair< TrueVolumeType, TrueVolume > getVolume() const
Returns the volume and its type associated with these bounds.
Definition types.hpp:1269
void setOrientationOffset(const glm::quat &newOrientation)
Sets orientation offset relative to the scene node's orientation.
Definition types.cpp:295
glm::vec3 getPositionWorld() const
The final position of the origin of the object bounds in the world.
Definition types.cpp:243
glm::vec3 mPositionOffset
The position of the origin of the spatial query volume relative to the origin of the node it is attac...
Definition types.hpp:1045
bool mPhysicsRecomputeRequired
Flag set when this object's physics properties must be recomputed according to its new volume.
Definition types.hpp:1117
void setOrientationWorld(const glm::quat &newOrientation)
Sets the new world orientation for the object while keeping its offset relative to its entity fixed.
Definition types.cpp:277
glm::mat4 getRotationTransformOrigin() const
Gets the rotation matrix associated with the underlying scene object's orientation.
Definition types.hpp:1140
glm::quat mOrientationOffset
The transformation mapping forward as known by the underlying scene node, to forward as known by the ...
Definition types.hpp:1063
std::array< glm::vec3, 8 > getVolumeRelativeBoxCorners() const
Gets the corners of the box just encapsulating this object's true volume, relative to the origin of t...
Definition types.cpp:229
bool mVolumeUpdateRequired
Flag set when this object's bounds must be recomputed by a related system.
Definition types.hpp:1110
bool mUpdatedFromTransform
Whether an update on the object's transform is allowed to modify object bounds properties.
Definition types.hpp:1081
void setVolumeSphere(float radius)
Sets a sphere volume for this object.
Definition types.hpp:1317
glm::mat3 getRotationTransformLocal() const
Gets the rotation matrix associated with this object's orientation offset.
Definition types.hpp:1131
TrueVolumeType
The types of volumes supported by the engine.
Definition types.hpp:938
A set of numbers describing a plane situated somewhere in the world.
Definition types.hpp:581
bool isPositiveStrict() const
Same as Plane::isSensible().
Definition types.hpp:618
glm::vec3 mNormal
A vector normal to the plane.
Definition types.hpp:592
glm::vec3 mPointOnPlane
A known point on the plane.
Definition types.hpp:586
bool isSensible() const
Tests whether the plane described is sensible (as opposed to invalid, infinite, or degenerate).
Definition types.hpp:600
Stores the indices of a single face of this polytope.
Definition types.hpp:722
A set of numbers describing a ray with its source at some finite point in the world,...
Definition types.hpp:528
float mLength
The length of the ray, infinite by default.
Definition types.hpp:545
glm::vec3 mStart
A point representing the starting point of the ray.
Definition types.hpp:533
glm::vec3 mDirection
The direction the ray is pointing in.
Definition types.hpp:539
bool isPositiveStrict() const
Tests whether the ray actually travels any distance from its origin.
Definition types.hpp:571
bool isSensible() const
Tests whether the ray is sensible (as opposed to invalid).
Definition types.hpp:553
Primitive for GJK algorithm.
Definition types.hpp:630
std::array< glm::vec3, 4 > mPointsSupportA
The point on the LHS of the Minkowski difference, where each index corresponds to a point on mPoints.
Definition types.hpp:642
std::array< glm::vec3, 4 > mPointsSupportB
The point on the RHS of the Minkowski difference, where each index corresponds to a point on mPoints.
Definition types.hpp:648
std::pair< bool, glm::vec3 > evaluate()
Tries to find a 3-simplex that encloses the origin.
Definition types.cpp:665
bool append(const glm::vec3 &candidatePoint, const glm::vec3 &supportA, const glm::vec3 &supportB)
Adds a new point to the simplex.
Definition types.hpp:662
uint8_t mNPoints
The number of points in this simplex.
Definition types.hpp:654
void reorder(const std::vector< uint8_t > reorderedIndices)
Replaces the current simplex with points from a new list (which will usually have as many or fewer po...
Definition types.hpp:678
std::array< glm::vec3, 4 > mPoints
Points representing the simplex, derived by finding the Minksowski difference of support points on tw...
Definition types.hpp:636
The base class of all spatial query volumes.
Definition types.hpp:147
bool isSensible() const
Returns whether or not the derived volume has sensible parameters (i.e., isn't infinite or invalid).
Definition types.hpp:207
static std::array< glm::vec3, 8 > ComputeBoxCorners(const glm::vec3 &boxDimensions)
Computes the model relative corners of a box, given the dimensions of the box.
Definition types.hpp:172
static constexpr std::array< glm::vec3, 8 > GetCornerSignsArray()
Returns an array populated with axis-wise sign multipliers, where the positions on the array correspo...
Definition types.hpp:156
bool isPositiveStrict() const
Returns whether or not the derived volume has strictly positive parameters.
Definition types.hpp:220
std::array< glm::vec3, 8 > getVolumeRelativeBoxCorners() const
Gets corners of the object-relative bounding box that encapsulates the derived volume.
Definition types.hpp:192
Holds the parameters describing the spatial query volume of a simple three-dimensionsal box.
Definition types.hpp:264
bool isSensible() const
Tests whether the values representing the box are valid (as opposed to invalid or infinite).
Definition types.hpp:286
glm::vec3 mDimensions
The dimensions of the box, its width, height, and depth.
Definition types.hpp:269
bool isPositiveStrict() const
Tests whether the values representing the box are strictly positive.
Definition types.hpp:296
std::array< glm::vec3, 8 > getVolumeRelativeBoxCorners() const
Returns an array of coordinates corresponding to the corners of the box.
Definition types.hpp:276
Holds the parameters describing the spatial query volume of a simple three-dimensionsal capsule (or p...
Definition types.hpp:306
float mRadius
The radius of the hemispheres on either end of the capsule.
Definition types.hpp:317
std::array< glm::vec3, 8 > getVolumeRelativeBoxCorners() const
Gets an array containing the coordinates of the corners of the volume aligned box just containing the...
Definition types.hpp:324
float mHeight
The height of the cylindrical section of the capsule.
Definition types.hpp:311
bool isPositiveStrict() const
Tests whether the values representing the capsule are all strictly positive.
Definition types.hpp:351
bool isSensible() const
Tests whether the values representing the capsule make sense (as opposed to being invalid or infinite...
Definition types.hpp:337
Holds parameters describing a spherical spatial query volume.
Definition types.hpp:365
float mRadius
The radius of the sphere.
Definition types.hpp:370
std::array< glm::vec3, 8 > getVolumeRelativeBoxCorners() const
Gets an array of coordinates of corners of a box just encapsulating the sphere.
Definition types.hpp:377
bool isPositiveStrict() const
Tests whether this volume's parameters are strictly positive.
Definition types.hpp:398
bool isSensible() const
Tests whether this volume's parameters are sensible (as opposed to invalid or infinite).
Definition types.hpp:387
bool isPositiveStrict() const
Poor man's vtable cont'd.
Definition types.hpp:254
bool isSensible() const
Poor man's vtable cont'd.
Definition types.hpp:244
std::array< glm::vec3, 8 > getVolumeRelativeBoxCorners() const
Poor man's vtable cont'd.
Definition types.hpp:234
A union of supported volume structs.
Definition types.hpp:948