Panda3D
|
00001 // Filename: collisionGeom.h 00002 // Created by: drose (01Mar06) 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 COLLISIONGEOM_H 00016 #define COLLISIONGEOM_H 00017 00018 #include "pandabase.h" 00019 00020 #include "collisionPolygon.h" 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // Class : CollisionGeom 00024 // Description : A special CollisionPolygon created just for the 00025 // purpose of detecting collision against geometry. 00026 // This kind of object does not have any persistance in 00027 // the scene graph; it is created on-the-fly. 00028 // 00029 // You should not attempt to create one of these 00030 // directly; it is created only by the 00031 // CollisionTraverser, as needed. 00032 //////////////////////////////////////////////////////////////////// 00033 class EXPCL_PANDA_COLLIDE CollisionGeom : public CollisionPolygon { 00034 private: 00035 INLINE CollisionGeom(const LVecBase3 &a, const LVecBase3 &b, 00036 const LVecBase3 &c); 00037 INLINE CollisionGeom(const CollisionGeom ©); 00038 00039 public: 00040 virtual CollisionSolid *make_copy(); 00041 00042 virtual PStatCollector &get_volume_pcollector(); 00043 virtual PStatCollector &get_test_pcollector(); 00044 00045 virtual void output(ostream &out) const; 00046 00047 private: 00048 static PStatCollector _volume_pcollector; 00049 static PStatCollector _test_pcollector; 00050 00051 public: 00052 static TypeHandle get_class_type() { 00053 return _type_handle; 00054 } 00055 static void init_type() { 00056 CollisionPolygon::init_type(); 00057 register_type(_type_handle, "CollisionGeom", 00058 CollisionPolygon::get_class_type()); 00059 } 00060 virtual TypeHandle get_type() const { 00061 return get_class_type(); 00062 } 00063 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00064 00065 private: 00066 static TypeHandle _type_handle; 00067 00068 friend class CollisionTraverser; 00069 }; 00070 00071 #include "collisionGeom.I" 00072 00073 #endif 00074 00075