mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
don't introduce matrix errors from the pusher
This commit is contained in:
parent
f55e4d2e1e
commit
ea1b5a99f6
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user