don't introduce matrix errors from the lifter

This commit is contained in:
David Rose 2003-07-07 23:41:20 +00:00
parent 3ea371a282
commit f55e4d2e1e
1 changed files with 17 additions and 4 deletions

View File

@ -125,10 +125,23 @@ handle_entries() {
adjust = max(adjust, -max_adjust);
}
LMatrix4f mat;
def.get_mat(mat);
mat(3, 2) += adjust;
def.set_mat(mat);
if (def._node != (PandaNode *)NULL) {
// If we are adjusting a plain PandaNode, get the
// transform and adjust just the Z value to preserve
// maximum precision.
CPT(TransformState) trans = def._node->get_transform();
LVecBase3f pos = trans->get_pos();
pos[2] += adjust;
def._node->set_transform(trans->set_pos(pos));
} else {
// Otherwise, go ahead and do the matrix math to do things
// the old and clumsy way.
LMatrix4f mat;
def.get_mat(mat);
mat(3, 2) += adjust;
def.set_mat(mat);
}
} else {
if (collide_cat.is_spam()) {
collide_cat.spam()