Panda3D
 All Classes Functions Variables Enumerations
collisionHandler.h
1 // Filename: collisionHandler.h
2 // Created by: drose (16Mar02)
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 COLLISIONHANDLER_H
16 #define COLLISIONHANDLER_H
17 
18 #include "pandabase.h"
19 
20 #include "typedReferenceCount.h"
21 #include "nodePath.h"
22 
23 class CollisionEntry;
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : CollisionHandler
27 // Description : The abstract interface to a number of classes that
28 // decide what to do when a collision is detected. One
29 // of these must be assigned to the CollisionTraverser
30 // that is processing collisions in order to specify how
31 // to dispatch detected collisions.
32 ////////////////////////////////////////////////////////////////////
33 class EXPCL_PANDA_COLLIDE CollisionHandler : public TypedReferenceCount {
34 public:
36 
37  virtual void begin_group();
38  virtual void add_entry(CollisionEntry *entry);
39  virtual bool end_group();
40 
41  INLINE bool wants_all_potential_collidees() const;
42  INLINE void set_root(const NodePath &root);
43 
44 PUBLISHED:
45  static TypeHandle get_class_type() {
46  return _type_handle;
47  }
48 
49 public:
50  static void init_type() {
51  TypedReferenceCount::init_type();
52  register_type(_type_handle, "CollisionHandler",
53  TypedReferenceCount::get_class_type());
54  }
55  virtual TypeHandle get_type() const {
56  return get_class_type();
57  }
58  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
59 
60 protected:
61  bool _wants_all_potential_collidees;
62  const NodePath *_root;
63 
64 private:
65  static TypeHandle _type_handle;
66 
67  friend class CollisionTraverser;
68 };
69 
70 #include "collisionHandler.I"
71 
72 #endif
73 
74 
75 
The abstract interface to a number of classes that decide what to do when a collision is detected...
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
Defines a single collision event.
This class manages the traversal through the scene graph to detect collisions.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165