Panda3D

finiteBoundingVolume.h

00001 // Filename: finiteBoundingVolume.h
00002 // Created by:  drose (02Oct99)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef FINITEBOUNDINGVOLUME_H
00016 #define FINITEBOUNDINGVOLUME_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "geometricBoundingVolume.h"
00021 
00022 
00023 ////////////////////////////////////////////////////////////////////
00024 //       Class : FiniteBoundingVolume
00025 // Description : A special kind of GeometricBoundingVolume that is
00026 //               known to be finite.  It is possible to query this
00027 //               kind of volume for its minimum and maximum extents.
00028 ////////////////////////////////////////////////////////////////////
00029 class EXPCL_PANDA_MATHUTIL FiniteBoundingVolume : public GeometricBoundingVolume {
00030 PUBLISHED:
00031   virtual LPoint3 get_min() const=0;
00032   virtual LPoint3 get_max() const=0;
00033   virtual PN_stdfloat get_volume() const;
00034 
00035 public:
00036   virtual const FiniteBoundingVolume *as_finite_bounding_volume() const;
00037 
00038 protected:
00039   virtual bool around_lines(const BoundingVolume **first,
00040                             const BoundingVolume **last);
00041   virtual bool around_planes(const BoundingVolume **first,
00042                             const BoundingVolume **last);
00043 
00044 public:
00045   static TypeHandle get_class_type() {
00046     return _type_handle;
00047   }
00048   static void init_type() {
00049     GeometricBoundingVolume::init_type();
00050     register_type(_type_handle, "FiniteBoundingVolume",
00051                   GeometricBoundingVolume::get_class_type());
00052   }
00053   virtual TypeHandle get_type() const {
00054     return get_class_type();
00055   }
00056   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00057 
00058 private:
00059   static TypeHandle _type_handle;
00060 };
00061 
00062 #endif
00063 
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073 
00074 
00075 
00076 
00077 
00078 
00079 
00080 
00081 
 All Classes Functions Variables Enumerations