Browse Source

collide: Allow creating dummy CollisionHandler

Useful for benchmarks or unit tests where the result does not matter.
rdb 3 years ago
parent
commit
a2890c03de
2 changed files with 5 additions and 14 deletions
  1. 0 8
      panda/src/collide/collisionHandler.cxx
  2. 5 6
      panda/src/collide/collisionHandler.h

+ 0 - 8
panda/src/collide/collisionHandler.cxx

@@ -15,14 +15,6 @@
 
 TypeHandle CollisionHandler::_type_handle;
 
-/**
- *
- */
-CollisionHandler::
-CollisionHandler() {
-  _wants_all_potential_collidees = false;
-}
-
 /**
  * Will be called by the CollisionTraverser before a new traversal is begun.
  * It instructs the handler to reset itself in preparation for a number of

+ 5 - 6
panda/src/collide/collisionHandler.h

@@ -28,9 +28,10 @@ class CollisionEntry;
  * dispatch detected collisions.
  */
 class EXPCL_PANDA_COLLIDE CollisionHandler : public TypedReferenceCount {
-public:
-  CollisionHandler();
+PUBLISHED:
+  CollisionHandler() = default;
 
+public:
   virtual void begin_group();
   virtual void add_entry(CollisionEntry *entry);
   virtual bool end_group();
@@ -38,12 +39,10 @@ public:
   INLINE bool wants_all_potential_collidees() const;
   INLINE void set_root(const NodePath &root);
 
-PUBLISHED:
+public:
   static TypeHandle get_class_type() {
     return _type_handle;
   }
-
-public:
   static void init_type() {
     TypedReferenceCount::init_type();
     register_type(_type_handle, "CollisionHandler",
@@ -55,7 +54,7 @@ public:
   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
 
 protected:
-  bool _wants_all_potential_collidees;
+  bool _wants_all_potential_collidees = false;
   const NodePath *_root;
 
 private: