Răsfoiți Sursa

properly load old animations when temp_hpr_fix is in effect

David Rose 21 ani în urmă
părinte
comite
97567cab47
1 a modificat fișierele cu 13 adăugiri și 3 ștergeri
  1. 13 3
      panda/src/chan/animChannelMatrixXfmTable.cxx

+ 13 - 3
panda/src/chan/animChannelMatrixXfmTable.cxx

@@ -378,9 +378,19 @@ fillin(DatagramIterator &scan, BamReader *manager) {
     PTA_float r_table = PTA_float::empty_array(hprs.size());
 
     for (i = 0; i < (int)hprs.size(); i++) {
-      h_table[i] = hprs[i][0];
-      p_table[i] = hprs[i][1];
-      r_table[i] = hprs[i][2];
+      if (!new_hpr && temp_hpr_fix) {
+        // Convert the old HPR form to the new HPR form.
+        LVecBase3f hpr = old_to_new_hpr(hprs[i]);
+        h_table[i] = hpr[0];
+        p_table[i] = hpr[1];
+        r_table[i] = hpr[2];
+
+      } else {
+        // Store the HPR angle directly.
+        h_table[i] = hprs[i][0];
+        p_table[i] = hprs[i][1];
+        r_table[i] = hprs[i][2];
+      }
     }
     _tables[6] = h_table;
     _tables[7] = p_table;