| Support Forum Library Source SourceForge Page G3D Web Page |
An axis-aligned box. More...
Public Member Functions | |
| AABox () | |
| Creates the empty bounds, i.e., an empty set of points. | |
| AABox (const Point3 &v) | |
| Constructs a zero-volume AABox at v. | |
| AABox (const class Any &a) | |
| Format is one of: | |
| AABox (const Point3 &low, const Point3 &high) | |
| Assumes that low is less than or equal to high along each dimension. | |
| float | area () const |
| Point3 | center () const |
| Returns the centroid of the box (NaN if empty) | |
| bool | contains (const AABox &other) const |
| less than or equal to containment | |
| bool | contains (const Point3 &point) const |
| Point3 | corner (int index) const |
| bool | culledBy (const Array< Plane > &plane, int32 &cullingPlaneIndex, const uint32 testMask, uint32 &childMask) const |
| Conservative culling test for up to 32 planes. | |
| bool | culledBy (const Array< Plane > &plane, int32 &cullingPlaneIndex=dummy, const uint32 testMask=0xFFFFFFFF) const |
| Conservative culling test that does not produce a mask for children. | |
| void | deserialize (class BinaryInput &b) |
| float | extent (int a) const |
| Distance from corner(0) to the next corner along axis a. | |
| Vector3 | extent () const |
| void | getBounds (AABox &out) const |
| void | getBounds (Sphere &out) const |
| size_t | hashCode () const |
| const Point3 & | high () const |
| Returns not-a-number if empty. | |
| AABox | intersect (const AABox &other) const |
| Return the intersection of the two boxes. | |
| bool | intersects (const AABox &other) const |
| Returns true if there is any overlap. | |
| bool | intersects (const Sphere &other) const |
| Returns true if there is any overlap. | |
| bool | isEmpty () const |
| bool | isFinite () const |
| const Point3 & | low () const |
| Returns not-a-number if empty. | |
| void | merge (const AABox &a) |
| Grows to include the bounds of a. | |
| void | merge (const Point3 &a) |
| bool | operator!= (const AABox &b) const |
| AABox | operator+ (const Vector3 &v) const |
| AABox | operator- (const Vector3 &v) const |
| bool | operator== (const AABox &b) const |
| Point3 | randomInteriorPoint () const |
| Point3 | randomSurfacePoint () const |
| void | serialize (class BinaryOutput &b) const |
| void | set (const Point3 &low, const Point3 &high) |
| Assumes that low is less than or equal to high along each dimension. | |
| void | split (const Vector3::Axis &axis, float location, AABox &low, AABox &high) const |
| Splits the box into two AABoxes along the specified axis. | |
| Any | toAny () const |
| float | volume () const |
Static Public Member Functions | |
| static const AABox & | empty () |
| static const AABox & | inf () |
| static const AABox & | large () |
| A large finite box. | |
| static const AABox & | maxFinite () |
| The largest possible finite box. | |
| static const AABox & | zero () |
Friends | |
| class | Intersect |
An axis-aligned box.
|
inline |
Creates the empty bounds, i.e., an empty set of points.
Referenced by intersect().
|
explicit |
Format is one of:
Assumes that low is less than or equal to high along each dimension.
To have this automatically enforced, use AABox(low.min(high), low.max(high));
|
inline |
|
inline |
Returns the centroid of the box (NaN if empty)
Referenced by G3D::TriangleShape::boundingSphere(), and G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Handle::Handle().
|
inline |
less than or equal to containment
Referenced by G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::assignSplitBounds(), G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::getIntersectingMembers(), and G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::verifyNode().
|
inline |
| bool G3D::AABox::culledBy | ( | const Array< Plane > & | plane, |
| int32 & | cullingPlaneIndex, | ||
| const uint32 | testMask, | ||
| uint32 & | childMask | ||
| ) | const |
Conservative culling test for up to 32 planes.
Returns true if there exists a plane[p] for which the entire object is in the negative half space (opposite the plane normal).
testMask and childMask are used for optimizing bounding volume hierarchies. The version of this method that produces childMask is slower than the version without; it should only be used for parent nodes.
| cullingPlaneIndex | The index of the first plane for which the entire object is in the negative half-space. The function exits early when one plane is found. -1 when the function returns false (i.e. when no plane culls the whole object). |
| testMask | If bit p is 0, the bounding volume automatically passes the culling test for plane[p] (i.e. it is known that the volume is entirely within the positive half space). The function must return false if testMask is 0 and test all planes when testMask is -1 (0xFFFFFFFF). |
| childMask | Test mask for the children of this volume. |
| bool G3D::AABox::culledBy | ( | const Array< Plane > & | plane, |
| int32 & | cullingPlaneIndex = dummy, |
||
| const uint32 | testMask = 0xFFFFFFFF |
||
| ) | const |
Conservative culling test that does not produce a mask for children.
| void G3D::AABox::deserialize | ( | class BinaryInput & | b | ) |
|
static |
Referenced by intersect().
|
inline |
Distance from corner(0) to the next corner along axis a.
Referenced by G3D::TriangleShape::boundingSphere().
|
inline |
|
inline |
Referenced by HashTrait< G3D::AABox >::hashCode().
|
inline |
Returns not-a-number if empty.
Referenced by AABox(), G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::assignSplitBounds(), G3D::KDTree< Triangle >::balance(), G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::findDeepestContainingNode(), G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::getIntersectingMembers(), G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::getIntersectingMembers(), G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::makeNode(), G3D::KDTree< Triangle >::makeNode(), G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::BoundsComparator::operator()(), G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Comparator::operator()(), G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::BoxIntersectionIterator::operator++(), G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::BoxIntersectionIterator::operator++(), set(), G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::verifyNode(), and G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::verifyNode().
|
static |
Return the intersection of the two boxes.
Referenced by G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Handle::Handle().
| bool G3D::AABox::intersects | ( | const AABox & | other | ) | const |
Returns true if there is any overlap.
Referenced by G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::getIntersectingMembers(), G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::BoxIntersectionIterator::operator++(), and G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::BoxIntersectionIterator::operator++().
| bool G3D::AABox::intersects | ( | const Sphere & | other | ) | const |
Returns true if there is any overlap.
|
inline |
Referenced by area(), extent(), intersect(), isFinite(), merge(), operator!=(), operator==(), and volume().
|
inline |
|
static |
A large finite box.
This is smaller than FLT_MAX because it leaves room to add boxes together.
Referenced by G3D::KDTree< Triangle >::balance(), and G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Handle::Handle().
|
inline |
Returns not-a-number if empty.
Referenced by AABox(), G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::assignSplitBounds(), G3D::KDTree< Triangle >::balance(), G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::findDeepestContainingNode(), G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::getIntersectingMembers(), G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::getIntersectingMembers(), G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::makeNode(), G3D::KDTree< Triangle >::makeNode(), G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::BoundsComparator::operator()(), G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Comparator::operator()(), G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::BoxIntersectionIterator::operator++(), G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::BoxIntersectionIterator::operator++(), set(), G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::verifyNode(), and G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::verifyNode().
|
static |
The largest possible finite box.
Referenced by G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::balance().
Grows to include the bounds of a.
Referenced by G3D::ArrowShape::boundingAABox(), G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::computeBounds(), and G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::insert().
|
inline |
|
inline |
| Point3 G3D::AABox::randomInteriorPoint | ( | ) | const |
| Point3 G3D::AABox::randomSurfacePoint | ( | ) | const |
| void G3D::AABox::serialize | ( | class BinaryOutput & | b | ) | const |
Assumes that low is less than or equal to high along each dimension.
| void G3D::AABox::split | ( | const Vector3::Axis & | axis, |
| float | location, | ||
| AABox & | low, | ||
| AABox & | high | ||
| ) | const |
Splits the box into two AABoxes along the specified axis.
low contains the part that was closer to negative infinity along axis, high contains the other part. Either may have zero volume.
Referenced by G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::assignSplitBounds(), and G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::assignSplitBounds().
| Any G3D::AABox::toAny | ( | ) | const |
|
inline |
|
static |
|
friend |
1.8.2