00001 // Filename: collisionHandler.h 00002 // Created by: drose (16Mar02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef COLLISIONHANDLER_H 00020 #define COLLISIONHANDLER_H 00021 00022 #include "pandabase.h" 00023 00024 #include "typedReferenceCount.h" 00025 00026 class CollisionEntry; 00027 00028 /////////////////////////////////////////////////////////////////// 00029 // Class : CollisionHandler 00030 // Description : The abstract interface to a number of classes that 00031 // decide what to do what a collision is detected. One 00032 // of these must be assigned to the CollisionTraverser 00033 // that is processing collisions in order to specify how 00034 // to dispatch detected collisions. 00035 //////////////////////////////////////////////////////////////////// 00036 class EXPCL_PANDA CollisionHandler : public TypedReferenceCount { 00037 public: 00038 virtual void begin_group(); 00039 virtual void add_entry(CollisionEntry *entry); 00040 virtual bool end_group(); 00041 00042 00043 PUBLISHED: 00044 static TypeHandle get_class_type() { 00045 return _type_handle; 00046 } 00047 00048 public: 00049 static void init_type() { 00050 TypedReferenceCount::init_type(); 00051 register_type(_type_handle, "CollisionHandler", 00052 TypedReferenceCount::get_class_type()); 00053 } 00054 virtual TypeHandle get_type() const { 00055 return get_class_type(); 00056 } 00057 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00058 00059 private: 00060 static TypeHandle _type_handle; 00061 00062 friend class CollisionTraverser; 00063 }; 00064 00065 #endif 00066 00067 00068