Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
|
Axis Aligned Bounding Box. More...
#include <aabbox3f.hpp>
Public Types | |
typedef jau::function< jau::math::Vec3f(const jau::math::Vec3f &)> | transform_vec3f_func |
General purpose Vec3f transform function. More... | |
Public Member Functions | |
AABBox3f () noexcept | |
Create an Axis Aligned bounding box (aabbox3f) where the low and and high MAX float Values. More... | |
constexpr | AABBox3f (AABBox3f &&o) noexcept=default |
constexpr | AABBox3f (const AABBox3f &o) noexcept=default |
AABBox3f (const Point3f &bl_, const Point3f &tr_) noexcept | |
Create an aabbox3f with given bl (low) and tr (high) More... | |
float | area2D () const noexcept |
Returns the assumed 2D area, i.e. More... | |
const Point3f & | center () const noexcept |
Returns computed center of this aabbox3f of low() and high(). More... | |
bool | contains (const AABBox3f &o) const noexcept |
Returns whether this aabbox3f fully contains given aabbox3f. More... | |
bool | contains (const float x, const float y) const noexcept |
Check if the 2D point is bounded/contained by this aabbox3f. More... | |
bool | contains (const float x, const float y, const float z) const noexcept |
Check if the 3D point is bounded/contained by this aabbox3f. More... | |
bool | contains (const Point2f &p) const noexcept |
Check if the 2D point is bounded/contained by this aabbox3f. More... | |
bool | contains (const Point3f &p) const noexcept |
Check if the 3D point is bounded/contained by this aabbox3f. More... | |
float | depth () const noexcept |
bool | getRayIntersection (Vec3f &result, const Ray3f &ray, const float epsilon, const bool assumeIntersection) |
Return intersection of a Ray with this bounding box, or false if none exist. More... | |
bool | hasZeroArea2D () const noexcept |
Return true if get2DArea() is FloatUtil#isZero(float) , considering epsilon. More... | |
bool | hasZeroVolume () const noexcept |
Return true if getVolume() is FloatUtil#isZero(float) , considering epsilon. More... | |
float | height () const noexcept |
const Point3f & | high () const noexcept |
Returns the maximum right-top-near (xyz) coordinate. More... | |
bool | intersects (const AABBox3f &o) const noexcept |
Returns whether this aabbox3f intersects (partially contains) given aabbox3f. More... | |
bool | intersects2DRegion (const float x, const float y, const float w, const float h) const noexcept |
Check if there is a common region between this AABBox and the passed 2D region irrespective of z range. More... | |
bool | intersectsRay (const Ray3f ray) const noexcept |
Check if Ray intersects this bounding box. More... | |
const Point3f & | low () const noexcept |
Returns the minimum left-bottom-far (xyz) coordinate. More... | |
AABBox3f & | operator= (AABBox3f &&) noexcept=default |
AABBox3f & | operator= (const AABBox3f &) noexcept=default |
AABBox3f & | reset () noexcept |
Reset this box to the inverse low/high, allowing the next resize(float, float, float) command to hit. More... | |
AABBox3f & | resize (const AABBox3f &newBox, transform_vec3f_func &transform) noexcept |
Resize the aabbox3f to encapsulate another AABox, which will be transformed on the fly first. More... | |
AABBox3f & | resize (const AABBox3f &o) noexcept |
Resize the aabbox3f to encapsulate another AABox. More... | |
AABBox3f & | resize (const float x, const float y, const float z) noexcept |
Resize the aabbox3f to encapsulate the passed xyz-coordinates. More... | |
AABBox3f & | resize (const float xyz[]) noexcept |
Resize the aabbox3f to encapsulate the passed xyz-coordinates. More... | |
AABBox3f & | resize (const Point3f &p) noexcept |
Resize the aabbox3f to encapsulate the passed xyz-coordinates. More... | |
AABBox3f & | resizeHeight (const float deltaBottom, const float deltaTop) noexcept |
Resize height of this aabbox3f with explicit bottom- and top delta values. More... | |
AABBox3f & | resizeWidth (const float deltaLeft, const float deltaRight) noexcept |
Resize width of this aabbox3f with explicit left- and right delta values. More... | |
AABBox3f & | setSize (const float low[], const float high[]) noexcept |
Set size of the aabbox3f specifying the coordinates of the low and high. More... | |
AABBox3f & | setSize (const float lx, const float ly, const float lz, const float hx, const float hy, const float hz) noexcept |
Set size of the aabbox3f specifying the coordinates of the low and high. More... | |
AABBox3f & | setSize (const Vec3f &low, const Vec3f &high) noexcept |
Set size of the aabbox3f specifying the coordinates of the low and high. More... | |
float | size () const noexcept |
Get the size of this aabbox3f where the size is represented by the length of the vector between low and high. More... | |
std::string | toString () const noexcept |
float | volume () const noexcept |
Returns the volume, i.e. More... | |
float | width () const noexcept |
Axis Aligned Bounding Box.
Defined by two 3D coordinates (low and high) The low being the the lower left corner of the box, and the high being the upper right corner of the box.
A few references for collision detection, intersections:
Definition at line 49 of file aabbox3f.hpp.
typedef jau::function<jau::math::Vec3f(const jau::math::Vec3f&)> jau::math::geom::AABBox3f::transform_vec3f_func |
General purpose Vec3f transform function.
Definition at line 263 of file aabbox3f.hpp.
|
inlinenoexcept |
Create an Axis Aligned bounding box (aabbox3f) where the low and and high MAX float Values.
Definition at line 63 of file aabbox3f.hpp.
Create an aabbox3f with given bl (low) and tr (high)
Definition at line 70 of file aabbox3f.hpp.
|
constexprdefaultnoexcept |
|
constexprdefaultnoexcept |
|
inlinenoexcept |
Reset this box to the inverse low/high, allowing the next resize(float, float, float)
command to hit.
Definition at line 97 of file aabbox3f.hpp.
|
inlinenoexcept |
Returns the maximum right-top-near (xyz) coordinate.
Definition at line 105 of file aabbox3f.hpp.
|
inlinenoexcept |
Returns the minimum left-bottom-far (xyz) coordinate.
Definition at line 108 of file aabbox3f.hpp.
|
inlinenoexcept |
Returns computed center of this aabbox3f of low() and high().
Definition at line 111 of file aabbox3f.hpp.
|
inlinenoexcept |
Get the size of this aabbox3f where the size is represented by the length of the vector between low and high.
Definition at line 118 of file aabbox3f.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns the volume, i.e.
width * height * depth
Definition at line 127 of file aabbox3f.hpp.
|
inlinenoexcept |
Return true if getVolume()
is FloatUtil#isZero(float)
, considering epsilon.
Definition at line 130 of file aabbox3f.hpp.
|
inlinenoexcept |
Returns the assumed 2D area, i.e.
width * height while assuming low and high lies on same plane.
Definition at line 133 of file aabbox3f.hpp.
|
inlinenoexcept |
Return true if get2DArea()
is FloatUtil#isZero(float)
, considering epsilon.
Definition at line 136 of file aabbox3f.hpp.
|
inlinenoexcept |
Set size of the aabbox3f specifying the coordinates of the low and high.
low | min xyz-coordinates |
high | max xyz-coordinates |
Definition at line 146 of file aabbox3f.hpp.
|
inlinenoexcept |
Set size of the aabbox3f specifying the coordinates of the low and high.
lx | min x-coordinate |
ly | min y-coordnate |
lz | min z-coordinate |
hx | max x-coordinate |
hy | max y-coordinate |
hz | max z-coordinate |
Definition at line 162 of file aabbox3f.hpp.
|
inlinenoexcept |
Set size of the aabbox3f specifying the coordinates of the low and high.
low | min xyz-coordinates |
high | max xyz-coordinates |
Definition at line 178 of file aabbox3f.hpp.
|
inlinenoexcept |
Resize width of this aabbox3f with explicit left- and right delta values.
deltaLeft | positive value will expand width, otherwise shrink width |
deltaRight | positive value will expand width, otherwise shrink width |
Definition at line 191 of file aabbox3f.hpp.
|
inlinenoexcept |
Resize height of this aabbox3f with explicit bottom- and top delta values.
deltaBottom | positive value will expand height, otherwise shrink height |
deltaTop | positive value will expand height, otherwise shrink height |
Definition at line 213 of file aabbox3f.hpp.
Resize the aabbox3f to encapsulate another AABox.
newBox | aabbox3f to be encapsulated in |
Definition at line 234 of file aabbox3f.hpp.
|
inlinenoexcept |
Resize the aabbox3f to encapsulate another AABox, which will be transformed on the fly first.
newBox | aabbox3f to be encapsulated in |
transform | the transform function, applied on newBox on the fly |
tmpV3 | temporary storage |
Definition at line 272 of file aabbox3f.hpp.
|
inlinenoexcept |
Resize the aabbox3f to encapsulate the passed xyz-coordinates.
x | x-axis coordinate value |
y | y-axis coordinate value |
z | z-axis coordinate value |
Definition at line 312 of file aabbox3f.hpp.
|
inlinenoexcept |
Resize the aabbox3f to encapsulate the passed xyz-coordinates.
xyz | xyz-axis coordinate values |
Definition at line 344 of file aabbox3f.hpp.
Resize the aabbox3f to encapsulate the passed xyz-coordinates.
xyz | xyz-axis coordinate values |
Definition at line 354 of file aabbox3f.hpp.
|
inlinenoexcept |
Check if the 2D point is bounded/contained by this aabbox3f.
Definition at line 362 of file aabbox3f.hpp.
|
inlinenoexcept |
Check if the 2D point is bounded/contained by this aabbox3f.
Definition at line 371 of file aabbox3f.hpp.
|
inlinenoexcept |
Check if the 3D point is bounded/contained by this aabbox3f.
Definition at line 377 of file aabbox3f.hpp.
|
inlinenoexcept |
Check if the 3D point is bounded/contained by this aabbox3f.
Definition at line 387 of file aabbox3f.hpp.
|
inlinenoexcept |
Returns whether this aabbox3f intersects (partially contains) given aabbox3f.
Definition at line 390 of file aabbox3f.hpp.
|
inlinenoexcept |
Returns whether this aabbox3f fully contains given aabbox3f.
Definition at line 400 of file aabbox3f.hpp.
|
inlinenoexcept |
Check if there is a common region between this AABBox and the passed 2D region irrespective of z range.
x | lower left x-coord |
y | lower left y-coord |
w | width |
h | hight |
Definition at line 418 of file aabbox3f.hpp.
|
inlinenoexcept |
Check if Ray
intersects this bounding box.
Versions uses the SAT[1], testing 6 axes. Original code for OBBs from MAGIC. Rewritten for AABBs and reorganized for early exits[2].
[1] SAT = Separating Axis Theorem [2] http://www.codercorner.com/RayAABB.cpp
ray |
Definition at line 449 of file aabbox3f.hpp.
|
inline |
Return intersection of a Ray
with this bounding box, or false if none exist.
Method is based on the requirements:
Report bugs: p.ter.nosp@m.dima.nosp@m.n@cod.nosp@m.erco.nosp@m.rner..nosp@m.com (original author)
[1] http://www.codercorner.com/RayAABB.cpp [2] http://tog.acm.org/resources/GraphicsGems/gems/RayBox.c
result | vec3 |
ray | |
epsilon | |
assumeIntersection | if true, method assumes an intersection, i.e. by pre-checking via intersectsRay(Ray) . In this case method will not validate a possible non-intersection and just computes coordinates. |
Definition at line 517 of file aabbox3f.hpp.
|
inlinenoexcept |
Definition at line 681 of file aabbox3f.hpp.