Przeglądaj źródła

oops, missed a PandaNode -> NodePath conversion

David Rose 22 lat temu
rodzic
commit
474209d9d1

+ 7 - 9
panda/src/collide/collisionHandlerEvent.I

@@ -27,13 +27,11 @@
 INLINE bool CollisionHandlerEvent::SortEntries::
 operator () (const PT(CollisionEntry) &a,
              const PT(CollisionEntry) &b) const {
-  if (a->get_from_node() != b->get_from_node()) {
-    return a->get_from_node() < b->get_from_node();
+  int compare_from = a->get_from_node_path().compare_to(b->get_from_node_path());
+  if (compare_from != 0) {
+    return compare_from < 0;
   }
-  if (a->get_into_node() != b->get_into_node()) {
-    return a->get_into_node() < b->get_into_node();
-  }
-  return false;
+  return a->get_into_node_path() < b->get_into_node_path();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -75,14 +73,14 @@ clear_in_patterns() {
 //                          CollisionNode, 'g' if it is a geom.
 //
 //                  %(tag)fh - generate event only if "from" node has
-//                          the indicated tag.
+//                          the indicated net tag.
 //                  %(tag)fx - generate event only if "from" node does 
-//                          not have the indicated tag.
+//                          not have the indicated net tag.
 //                  %(tag)ih - generate event only if "into" node has
 //                          the indicated net tag.
 //                  %(tag)ix - generate event only if "into" node does 
 //                          not have the indicated net tag.
-//                  %(tag)ft - the indicated tag value of the "from" node.
+//                  %(tag)ft - the indicated net tag value of the "from" node.
 //                  %(tag)it - the indicated net tag value of the "into" node.
 //
 //               Parentheses in the above are literal and should be

+ 5 - 5
panda/src/collide/collisionHandlerEvent.cxx

@@ -71,8 +71,8 @@ add_entry(CollisionEntry *entry) {
 
   if (collide_cat.is_spam()) {
     collide_cat.spam()
-      << "Detected collision from " << (void *)entry->get_from_node()
-      << " to " << (void *)entry->get_into_node()
+      << "Detected collision from " << entry->get_from_node_path()
+      << " to " << entry->get_into_node_path()
       << ", inserted = " << inserted << "\n";
   }
 }
@@ -227,12 +227,12 @@ throw_event_pattern(const string &pattern, CollisionEntry *entry) {
           (entry->has_into() ? 'c' : 'g');
 
       } else if (cmd == "fh") {
-        if (!entry->get_from_node()->has_tag(key)) {
+        if (!entry->get_from_node_path().has_net_tag(key)) {
           return;
         }
 
       } else if (cmd == "fx") {
-        if (entry->get_from_node()->has_tag(key)) {
+        if (entry->get_from_node_path().has_net_tag(key)) {
           return;
         }
 
@@ -247,7 +247,7 @@ throw_event_pattern(const string &pattern, CollisionEntry *entry) {
         }
 
       } else if (cmd == "ft") {
-        event += entry->get_from_node()->get_tag(key);
+        event += entry->get_from_node_path().get_net_tag(key);
 
       } else if (cmd == "it") {
         if (entry->has_into()) {

+ 1 - 1
panda/src/collide/collisionHandlerPhysical.cxx

@@ -69,7 +69,7 @@ add_entry(CollisionEntry *entry) {
 
   if (entry->get_from()->is_tangible() &&
       (!entry->has_into() || entry->get_into()->is_tangible())) {
-    _from_entries[entry->get_from_node()].push_back(entry);
+    _from_entries[entry->get_from_node_path()].push_back(entry);
   }
 }
 

+ 2 - 2
panda/src/collide/collisionPlane.cxx

@@ -123,7 +123,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
 
   if (collide_cat.is_debug()) {
     collide_cat.debug()
-      << "intersection detected from " << *entry.get_from_node() << " into "
+      << "intersection detected from " << entry.get_from_node_path() << " into "
       << entry.get_into_node_path() << "\n";
   }
   PT(CollisionEntry) new_entry = new CollisionEntry(entry);
@@ -165,7 +165,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
 
   if (collide_cat.is_debug()) {
     collide_cat.debug()
-      << "intersection detected from " << *entry.get_from_node() << " into "
+      << "intersection detected from " << entry.get_from_node_path() << " into "
       << entry.get_into_node_path() << "\n";
   }
   PT(CollisionEntry) new_entry = new CollisionEntry(entry);

+ 3 - 3
panda/src/collide/collisionPolygon.cxx

@@ -425,7 +425,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
 
   if (collide_cat.is_debug()) {
     collide_cat.debug()
-      << "intersection detected from " << *entry.get_from_node() << " into "
+      << "intersection detected from " << entry.get_from_node_path() << " into "
       << entry.get_into_node_path() << "\n";
   }
   PT(CollisionEntry) new_entry = new CollisionEntry(entry);
@@ -501,7 +501,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
 
   if (collide_cat.is_debug()) {
     collide_cat.debug()
-      << "intersection detected from " << *entry.get_from_node() << " into "
+      << "intersection detected from " << entry.get_from_node_path() << " into "
       << entry.get_into_node_path() << "\n";
   }
   PT(CollisionEntry) new_entry = new CollisionEntry(entry);
@@ -570,7 +570,7 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
 
   if (collide_cat.is_debug()) {
     collide_cat.debug()
-      << "intersection detected from " << *entry.get_from_node() << " into "
+      << "intersection detected from " << entry.get_from_node_path() << " into "
       << entry.get_into_node_path() << "\n";
   }
   PT(CollisionEntry) new_entry = new CollisionEntry(entry);

+ 3 - 3
panda/src/collide/collisionSphere.cxx

@@ -140,7 +140,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
 
   if (collide_cat.is_debug()) {
     collide_cat.debug()
-      << "intersection detected from " << *entry.get_from_node() << " into "
+      << "intersection detected from " << entry.get_from_node_path() << " into "
       << entry.get_into_node_path() << "\n";
   }
   PT(CollisionEntry) new_entry = new CollisionEntry(entry);
@@ -191,7 +191,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
 
   if (collide_cat.is_debug()) {
     collide_cat.debug()
-      << "intersection detected from " << *entry.get_from_node() << " into "
+      << "intersection detected from " << entry.get_from_node_path() << " into "
       << entry.get_into_node_path() << "\n";
   }
   PT(CollisionEntry) new_entry = new CollisionEntry(entry);
@@ -241,7 +241,7 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
 
   if (collide_cat.is_debug()) {
     collide_cat.debug()
-      << "intersection detected from " << *entry.get_from_node() << " into "
+      << "intersection detected from " << entry.get_from_node_path() << " into "
       << entry.get_into_node_path() << "\n";
   }
   PT(CollisionEntry) new_entry = new CollisionEntry(entry);

+ 3 - 3
panda/src/collide/collisionTube.cxx

@@ -165,7 +165,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
 
   if (collide_cat.is_debug()) {
     collide_cat.debug()
-      << "intersection detected from " << *entry.get_from_node() << " into "
+      << "intersection detected from " << entry.get_from_node_path() << " into "
       << entry.get_into_node_path() << "\n";
   }
   PT(CollisionEntry) new_entry = new CollisionEntry(entry);
@@ -213,7 +213,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
 
   if (collide_cat.is_debug()) {
     collide_cat.debug()
-      << "intersection detected from " << *entry.get_from_node() << " into "
+      << "intersection detected from " << entry.get_from_node_path() << " into "
       << entry.get_into_node_path() << "\n";
   }
   PT(CollisionEntry) new_entry = new CollisionEntry(entry);
@@ -263,7 +263,7 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
 
   if (collide_cat.is_debug()) {
     collide_cat.debug()
-      << "intersection detected from " << *entry.get_from_node() << " into "
+      << "intersection detected from " << entry.get_from_node_path() << " into "
       << entry.get_into_node_path() << "\n";
   }
   PT(CollisionEntry) new_entry = new CollisionEntry(entry);