From 97567cab47d752f3b646c8491edea05c4ce56d8f Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 22 Nov 2004 19:34:57 +0000 Subject: [PATCH] properly load old animations when temp_hpr_fix is in effect --- panda/src/chan/animChannelMatrixXfmTable.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/panda/src/chan/animChannelMatrixXfmTable.cxx b/panda/src/chan/animChannelMatrixXfmTable.cxx index 97c8505acd..c005b004b6 100644 --- a/panda/src/chan/animChannelMatrixXfmTable.cxx +++ b/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;