Procházet zdrojové kódy

small optimization

cxgeorge před 24 roky
rodič
revize
b050bd8459
1 změnil soubory, kde provedl 15 přidání a 6 odebrání
  1. 15 6
      panda/src/collide/collisionHandlerPusher.cxx

+ 15 - 6
panda/src/collide/collisionHandlerPusher.cxx

@@ -172,19 +172,28 @@ handle_entries() {
           }
           }
         }
         }
 
 
-        if (_horizontal) {
-          net_shove[2] = 0.0;
+        LMatrix4f mat;
+        def.get_mat(mat);
+
+        // def.set_mat(LMatrix4f::translate_mat(net_shove) * mat);
+
+        mat(3,0) += net_shove[0];
+        mat(3,1) += net_shove[1];
+
+        if (!_horizontal) {
+          mat(3,2) += net_shove[2];
         }
         }
 
 
+        def.set_mat(mat);
+
         if (collide_cat.is_debug()) {
         if (collide_cat.is_debug()) {
+          if (_horizontal)
+             net_shove[2] = 0.0;
+
           collide_cat.debug()
           collide_cat.debug()
             << "Net shove on " << *from_node << " is: "
             << "Net shove on " << *from_node << " is: "
             << net_shove << "\n";
             << net_shove << "\n";
         }
         }
-
-        LMatrix4f mat;
-        def.get_mat(mat);
-        def.set_mat(LMatrix4f::translate_mat(net_shove) * mat);
       }
       }
     }
     }
   }
   }