45 while (first != last && (*first)->
is_empty()) {
46 if ((*first)->is_infinite()) {
59 for (bvi = first; bvi != last; ++bvi) {
60 if ((*bvi)->is_infinite()) {
69 if (!(*first)->around_other(
this, first, last)) {
81write(ostream &out,
int indent_level)
const {
82 indent(out, indent_level) << *
this <<
"\n";
162 if (strcmp(str.c_str(),
"default") == 0) {
165 }
else if (strcmp(str.c_str(),
"best") == 0) {
168 }
else if (strcmp(str.c_str(),
"fastest") == 0) {
171 }
else if (strcmp(str.c_str(),
"sphere") == 0) {
174 }
else if (strcmp(str.c_str(),
"box") == 0) {
187 return extend_by_finite(sphere);
196 return extend_by_finite(box);
205 return extend_by_finite(hexahedron);
214 return extend_by_geometric(line);
223 return extend_by_geometric(plane);
232 return extend_by_geometric(unionv);
241 return extend_by_geometric(intersection);
249 return extend_by_geometric(volume);
257 mathutil_cat.warning()
258 << get_type() <<
"::extend_by_geometric() called with " << volume->get_type() <<
"\n";
269 return around_finite(first, last);
278 return around_finite(first, last);
287 return around_finite(first, last);
296 return around_geometric(first, last);
305 return around_geometric(first, last);
314 return around_geometric(first, last);
323 return around_geometric(first, last);
331 return around_geometric(first, last);
339 mathutil_cat.warning()
340 << get_type() <<
"::extend_by_geometric() called with " << first[0]->get_type() <<
"\n";
351 return contains_finite(sphere);
360 return contains_finite(box);
369 return contains_finite(hexahedron);
378 return contains_geometric(line);
387 return contains_geometric(plane);
396 return unionv->other_contains_union(
this);
405 return intersection->other_contains_intersection(
this);
413 return contains_geometric(volume);
421 mathutil_cat.warning()
422 << get_type() <<
"::contains_geometric() called with " << volume->get_type() <<
"\n";
423 return IF_dont_understand;
427operator << (ostream &out, BoundingVolume::BoundsType type) {
429 case BoundingVolume::BT_default:
430 return out <<
"default";
432 case BoundingVolume::BT_best:
433 return out <<
"best";
435 case BoundingVolume::BT_fastest:
436 return out <<
"fastest";
438 case BoundingVolume::BT_sphere:
439 return out <<
"sphere";
441 case BoundingVolume::BT_box:
446 <<
"Invalid BoundingVolume::BoundsType value: " << (int)type <<
"\n";
447 nassertr(
false, out);
452operator >> (istream &in, BoundingVolume::BoundsType &type) {
456 if (type == BoundingVolume::BT_default) {
457 mathutil_cat->error()
458 <<
"Invalid BoundingVolume::BoundsType string: " << word <<
"\n";
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An axis-aligned bounding box; that is, a minimum and maximum coordinate triple.
This defines a bounding convex hexahedron.
This funny bounding volume is an infinite line with no thickness and extending to infinity in both di...
This funny bounding volume is an infinite plane that divides space into two regions: the part behind ...
This defines a bounding sphere, consisting of a center and a radius.
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
virtual const BoundingPlane * as_bounding_plane() const
Virtual downcast method.
static BoundsType string_bounds_type(const std::string &str)
Returns the BoundsType corresponding to the indicated string.
bool is_empty() const
Any kind of volume might be empty.
virtual const BoundingSphere * as_bounding_sphere() const
Virtual downcast method.
virtual const BoundingBox * as_bounding_box() const
Virtual downcast method.
virtual GeometricBoundingVolume * as_geometric_bounding_volume()
Virtual downcast method.
virtual const FiniteBoundingVolume * as_finite_bounding_volume() const
Virtual downcast method.
virtual const BoundingHexahedron * as_bounding_hexahedron() const
Virtual downcast method.
virtual const BoundingLine * as_bounding_line() const
Virtual downcast method.
bool around(const BoundingVolume **first, const BoundingVolume **last)
Resets the volume to enclose only the volumes indicated.
A special kind of GeometricBoundingVolume that is known to be finite.
This is another abstract class, for a general class of bounding volumes that actually enclose points ...
This special bounding volume is the intersection of all of its constituent bounding volumes.
TypeHandle is the identifier used to differentiate C++ class types.
This special bounding volume is the union of all of its constituent bounding volumes.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.