15 #ifndef BOUNDINGVOLUME_H 16 #define BOUNDINGVOLUME_H 18 #include "pandabase.h" 20 #include "typedObject.h" 21 #include "typedReferenceCount.h" 22 #include "deletedChain.h" 50 virtual BoundingVolume *make_copy()
const=0;
52 INLINE_MATHUTIL
bool is_empty()
const;
53 INLINE_MATHUTIL
bool is_infinite()
const;
55 INLINE_MATHUTIL
void set_infinite();
57 INLINE_MATHUTIL
bool extend_by(
const BoundingVolume *vol);
63 bool around(
const BoundingVolume **first,
64 const BoundingVolume **last);
69 enum IntersectionFlags {
71 IF_no_intersection = 0,
96 IF_dont_understand = 0x08
99 INLINE_MATHUTIL
int contains(
const BoundingVolume *vol)
const;
101 virtual void output(ostream &out)
const=0;
102 virtual void write(ostream &out,
int indent_level = 0)
const;
118 virtual const BoundingBox *as_bounding_box()
const;
123 static BoundsType string_bounds_type(
const string &str);
138 virtual bool extend_other(BoundingVolume *other)
const=0;
139 virtual bool around_other(BoundingVolume *other,
140 const BoundingVolume **first,
141 const BoundingVolume **last)
const=0;
142 virtual int contains_other(
const BoundingVolume *other)
const=0;
147 virtual bool extend_by_box(
const BoundingBox *box);
156 virtual bool around_spheres(
const BoundingVolume **first,
157 const BoundingVolume **last);
158 virtual bool around_boxes(
const BoundingVolume **first,
159 const BoundingVolume **last);
160 virtual bool around_hexahedrons(
const BoundingVolume **first,
161 const BoundingVolume **last);
162 virtual bool around_lines(
const BoundingVolume **first,
163 const BoundingVolume **last);
164 virtual bool around_planes(
const BoundingVolume **first,
165 const BoundingVolume **last);
166 virtual bool around_unions(
const BoundingVolume **first,
167 const BoundingVolume **last);
168 virtual bool around_intersections(
const BoundingVolume **first,
169 const BoundingVolume **last);
170 virtual bool around_finite(
const BoundingVolume **first,
171 const BoundingVolume **last);
172 virtual bool around_geometric(
const BoundingVolume **first,
173 const BoundingVolume **last);
176 virtual int contains_box(
const BoundingBox *box)
const;
178 virtual int contains_line(
const BoundingLine *line)
const;
179 virtual int contains_plane(
const BoundingPlane *plane)
const;
190 static void init_type() {
191 TypedReferenceCount::init_type();
192 register_type(_type_handle,
"BoundingVolume",
193 TypedReferenceCount::get_class_type());
196 return get_class_type();
198 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
212 INLINE_MATHUTIL ostream &operator << (ostream &out,
const BoundingVolume &bound);
214 #include "boundingVolume.I" 216 EXPCL_PANDA_MATHUTIL ostream &operator << (ostream &out, BoundingVolume::BoundsType type);
217 EXPCL_PANDA_MATHUTIL istream &operator >> (istream &in, BoundingVolume::BoundsType &type);
An axis-aligned bounding box; that is, a minimum and maximum coordinate triple.
This defines a bounding sphere, consisting of a center and a radius.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
This funny bounding volume is an infinite plane that divides space into two regions: the part behind ...
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
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...
This special bounding volume is the union of all of its constituent bounding volumes.
A special kind of GeometricBoundingVolume that is known to be finite.
TypeHandle is the identifier used to differentiate C++ class types.
This defines a bounding convex hexahedron.
This funny bounding volume is an infinite line with no thickness and extending to infinity in both di...