don't introduce matrix errors from the pusher

This commit is contained in:
David Rose 2003-07-08 01:03:49 +00:00
parent f55e4d2e1e
commit ea1b5a99f6

View File

@ -252,6 +252,17 @@ handle_entries() {
} }
#endif #endif
if (def._node != (PandaNode *)NULL) {
// If we are adjusting a plain PandaNode, get the
// transform and adjust just the position to preserve
// maximum precision.
CPT(TransformState) trans = def._node->get_transform();
LVecBase3f pos = trans->get_pos();
pos += net_shove * trans->get_mat();
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; LMatrix4f mat;
def.get_mat(mat); def.get_mat(mat);
def.set_mat(LMatrix4f::translate_mat(net_shove) * mat); def.set_mat(LMatrix4f::translate_mat(net_shove) * mat);
@ -259,6 +270,7 @@ handle_entries() {
} }
} }
} }
}
return okflag; return okflag;
} }