Browse Source

don't flatten together collision nodes with different bitmasks

David Rose 18 years ago
parent
commit
bdc9dfd5f0
1 changed files with 5 additions and 2 deletions
  1. 5 2
      panda/src/collide/collisionNode.cxx

+ 5 - 2
panda/src/collide/collisionNode.cxx

@@ -145,9 +145,12 @@ combine_with(PandaNode *other) {
   if (is_exact_type(get_class_type()) &&
       other->is_exact_type(get_class_type())) {
     // Two CollisionNodes can combine, but only if they have the same
-    // name, because the name is often meaningful.
+    // name, because the name is often meaningful, and only if they
+    // have the same collide masks.
     CollisionNode *cother = DCAST(CollisionNode, other);
-    if (get_name() == cother->get_name()) {
+    if (get_name() == cother->get_name() &&
+        get_from_collide_mask() == cother->get_from_collide_mask() &&
+        get_into_collide_mask() == cother->get_into_collide_mask()) {
       const COWPT(CollisionSolid) *solids_begin = &cother->_solids[0];
       const COWPT(CollisionSolid) *solids_end = solids_begin + cother->_solids.size();
       _solids.insert(_solids.end(), solids_begin, solids_end);