#include <tbu_bounding_volume.hpp>
TODO: TurtleBrains: Documentation: Teach the user how to use this.
◆ BoundingVolume() [1/2]
| TurtleBrains::Math::Unstable::BoundingVolume::BoundingVolume |
( |
float |
radius | ) |
|
|
explicit |
Constructs a Circle shaped bounding volume with the given radius.
- Parameters
-
| radius | The radius of the circle to use for bounding an object, must be greater than 0 or an error will be triggered. The units are technically undetermined but may often correlate with pixels as in with the Entity. |
◆ BoundingVolume() [2/2]
| TurtleBrains::Math::Unstable::BoundingVolume::BoundingVolume |
( |
float |
width, |
|
|
float |
height |
|
) |
| |
|
explicit |
Constructs a Box shaped bounding volume with the given width and height.
- Parameters
-
| width | The horizontal width of the objects bounding box, must be greater than 0 or an error will be triggered. The units are technically undetermined but may often correlate with pixels as in with the Entity. |
| height | The vertical height of the objects bounding box, , must be greater than 0 or an error will be triggered. The units are technically undetermined but may often correlate with pixels as in with the Entity. |
◆ ~BoundingVolume()
| TurtleBrains::Math::Unstable::BoundingVolume::~BoundingVolume |
( |
void |
| ) |
|
◆ CheckCollisionWith() [1/2]
Checks to see if two bounding volumes are colliding and returns true if the volumes are intersecting, or false if there is no parts intersecting.
- Parameters
-
| objectPosition | The position of this bounding volume to check the collision with the other volume. |
| testVolume | The other bounding volume to check if any parts are intersecting with this volume. |
| testVolumePosition | The position of the other bounding volume to check for intersection. |
◆ CheckCollisionWith() [2/2]
| bool TurtleBrains::Math::Unstable::BoundingVolume::CheckCollisionWith |
( |
const tbMath::Vector2 & |
objectPosition, |
|
|
const tbMath::Vector2 & |
testPoint |
|
) |
| const |
Checks to see if a point exists in the bounding volume and returns true if the testPoint is found inside the bounding volume, or false if outside.
- Parameters
-
| objectPosition | The position of this bounding volume to check the collision with the testPoint. |
| testPoint | A single point to check if the position is located within this bounding volume. |
◆ GetHeight()
| float TurtleBrains::Math::Unstable::BoundingVolume::GetHeight |
( |
void |
| ) |
const |
|
inline |
Returns the height of a box bounding volume. This will trigger an error condition if the bounding volume is not a box.
◆ GetRadius()
| float TurtleBrains::Math::Unstable::BoundingVolume::GetRadius |
( |
void |
| ) |
const |
|
inline |
Returns the radius of a circular bounding volume. This will trigger an error condition if the bounding volume is not a circle.
◆ GetWidth()
| float TurtleBrains::Math::Unstable::BoundingVolume::GetWidth |
( |
void |
| ) |
const |
|
inline |
Returns the width of a box bounding volume. This will trigger an error condition if the bounding volume is not a box.
◆ IsBox()
| bool TurtleBrains::Math::Unstable::BoundingVolume::IsBox |
( |
void |
| ) |
const |
Returns true if this BoundingVolume is a bounding box, otherwise false is returned.
◆ IsCircle()
| bool TurtleBrains::Math::Unstable::BoundingVolume::IsCircle |
( |
void |
| ) |
const |
Returns true if this BoundingVolume is a bounding circle, otherwise false is returned.
◆ ResolveCollisionWithStatic()
Attempts to move objectPosition so this bounding volume won't collide with the staticVolume at staticVolumePosition. Currently only works with two box volumes, other volumes will return false. The oobjectPosition will move along the axis with least penetration.
- Parameters
-
| objectPosition | The position of this bounding volume to resolve the collision with. It is expected that the collision has already been checked and is in an intersected state with staticVolume. This parameter will be modified internally and returned as the new position of the bounding volume. |
| staticVolume | The other bounding volume to resolve collision against, which does NOT move. |
| staticVolumePosition | The position of the other bounding volume. |
- Note
- This implementation is still very unstable and incomplete. Both bounding volumes must be a box.