mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
support loading new bams with temp-hpr-fix 0 too
This commit is contained in:
parent
6ba60ee09e
commit
ec6442c810
@ -339,8 +339,8 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!new_hpr && temp_hpr_fix) {
|
if ((!new_hpr && temp_hpr_fix) || (new_hpr && !temp_hpr_fix)) {
|
||||||
// Convert the old HPR form to the new HPR form.
|
// Convert between the old HPR form and the new HPR form.
|
||||||
size_t num_hprs = max(max(_tables[6].size(), _tables[7].size()),
|
size_t num_hprs = max(max(_tables[6].size(), _tables[7].size()),
|
||||||
_tables[8].size());
|
_tables[8].size());
|
||||||
|
|
||||||
@ -364,7 +364,12 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
|||||||
float p = (hi < _tables[7].size() ? _tables[7][hi] : default_hpr[1]);
|
float p = (hi < _tables[7].size() ? _tables[7][hi] : default_hpr[1]);
|
||||||
float r = (hi < _tables[8].size() ? _tables[8][hi] : default_hpr[2]);
|
float r = (hi < _tables[8].size() ? _tables[8][hi] : default_hpr[2]);
|
||||||
|
|
||||||
LVecBase3f hpr = old_to_new_hpr(LVecBase3f(h, p, r));
|
LVecBase3f hpr;
|
||||||
|
if (temp_hpr_fix) {
|
||||||
|
hpr = old_to_new_hpr(LVecBase3f(h, p, r));
|
||||||
|
} else {
|
||||||
|
hpr = new_to_old_hpr(LVecBase3f(h, p, r));
|
||||||
|
}
|
||||||
h_table[hi] = hpr[0];
|
h_table[hi] = hpr[0];
|
||||||
p_table[hi] = hpr[1];
|
p_table[hi] = hpr[1];
|
||||||
r_table[hi] = hpr[2];
|
r_table[hi] = hpr[2];
|
||||||
@ -422,6 +427,13 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
|||||||
p_table[i] = hpr[1];
|
p_table[i] = hpr[1];
|
||||||
r_table[i] = hpr[2];
|
r_table[i] = hpr[2];
|
||||||
|
|
||||||
|
} else if (new_hpr && !temp_hpr_fix) {
|
||||||
|
// Convert the new HPR form to the old HPR form.
|
||||||
|
LVecBase3f hpr = new_to_old_hpr(hprs[i]);
|
||||||
|
h_table[i] = hpr[0];
|
||||||
|
p_table[i] = hpr[1];
|
||||||
|
r_table[i] = hpr[2];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Store the HPR angle directly.
|
// Store the HPR angle directly.
|
||||||
h_table[i] = hprs[i][0];
|
h_table[i] = hprs[i][0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user