Panda3D
 All Classes Functions Variables Enumerations
omniBoundingVolume.h
1 // Filename: omniBoundingVolume.h
2 // Created by: drose (22Jun00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef OMNIBOUNDINGVOLUME_H
16 #define OMNIBOUNDINGVOLUME_H
17 
18 #include "pandabase.h"
19 
20 #include "geometricBoundingVolume.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : OmniBoundingVolume
24 // Description : This is a special kind of GeometricBoundingVolume
25 // that fills all of space.
26 ////////////////////////////////////////////////////////////////////
27 class EXPCL_PANDA_MATHUTIL OmniBoundingVolume : public GeometricBoundingVolume {
28 PUBLISHED:
29  INLINE_MATHUTIL OmniBoundingVolume();
30 
31 public:
32  virtual BoundingVolume *make_copy() const;
33 
34  virtual LPoint3 get_approx_center() const;
35  virtual void xform(const LMatrix4 &mat);
36 
37  virtual void output(ostream &out) const;
38 
39 protected:
40  virtual bool extend_other(BoundingVolume *other) const;
41  virtual bool around_other(BoundingVolume *other,
42  const BoundingVolume **first,
43  const BoundingVolume **last) const;
44  virtual int contains_other(const BoundingVolume *other) const;
45 
46 
47  virtual bool extend_by_point(const LPoint3 &point);
48  virtual bool extend_by_sphere(const BoundingSphere *sphere);
49  virtual bool extend_by_box(const BoundingBox *box);
50  virtual bool extend_by_hexahedron(const BoundingHexahedron *hexahedron);
51 
52  virtual bool around_points(const LPoint3 *first,
53  const LPoint3 *last);
54  virtual bool around_spheres(const BoundingVolume **first,
55  const BoundingVolume **last);
56  virtual bool around_boxes(const BoundingVolume **first,
57  const BoundingVolume **last);
58  virtual bool around_hexahedrons(const BoundingVolume **first,
59  const BoundingVolume **last);
60 
61  virtual int contains_point(const LPoint3 &point) const;
62  virtual int contains_lineseg(const LPoint3 &a, const LPoint3 &b) const;
63  virtual int contains_hexahedron(const BoundingHexahedron *hexahedron) const;
64  virtual int contains_sphere(const BoundingSphere *sphere) const;
65  virtual int contains_box(const BoundingBox *box) const;
66 
67 public:
68  static TypeHandle get_class_type() {
69  return _type_handle;
70  }
71  static void init_type() {
72  GeometricBoundingVolume::init_type();
73  register_type(_type_handle, "OmniBoundingVolume",
74  GeometricBoundingVolume::get_class_type());
75  }
76  virtual TypeHandle get_type() const {
77  return get_class_type();
78  }
79  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
80 
81 private:
82  static TypeHandle _type_handle;
83 
84  friend class BoundingHexahedron;
85 };
86 
87 #include "omniBoundingVolume.I"
88 
89 #endif
An axis-aligned bounding box; that is, a minimum and maximum coordinate triple.
Definition: boundingBox.h:31
This defines a bounding sphere, consisting of a center and a radius.
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
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 is a 4-by-4 transform matrix.
Definition: lmatrix.h:451
This is a special kind of GeometricBoundingVolume that fills all of space.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
This defines a bounding convex hexahedron.