-TT x,y,z doesn't work properly with vertex pools under a transform node

This commit is contained in:
David Rose 2003-11-21 06:47:31 +00:00
parent 447afa95d8
commit 75762f560a
4 changed files with 7 additions and 5 deletions

View File

@ -283,9 +283,11 @@ set_coordinate_system(CoordinateSystem new_coordsys) {
if (new_coordsys != _coordsys &&
(_coordsys != CS_default && _coordsys != CS_invalid)) {
// Time to convert the data.
r_transform(LMatrix4d::convert_mat(_coordsys, new_coordsys),
LMatrix4d::convert_mat(new_coordsys, _coordsys),
new_coordsys);
LMatrix4d mat = LMatrix4d::convert_mat(_coordsys, new_coordsys);
LMatrix4d inv = LMatrix4d::convert_mat(new_coordsys, _coordsys);
r_transform(mat, inv, new_coordsys);
r_transform_vertices(mat);
// Now we have to update the under_flags to ensure that all the
// cached relative matrices are correct.

View File

@ -971,7 +971,7 @@ adjust_under() {
void EggGroup::
r_transform(const LMatrix4d &mat, const LMatrix4d &inv,
CoordinateSystem to_cs) {
if (!transform_is_identity()) {
if (has_transform()) {
// Since we want to apply this transform to all matrices,
// including nested matrices, we can't simply premult it in and
// leave it, because that would leave the rotational component in

View File

@ -318,6 +318,7 @@ transform(const LMatrix4d &mat) {
LMatrix4d inv = invert(mat);
r_transform(mat, inv, CS_default);
r_transform_vertices(mat);
// Now we have to recompute the under_flags to ensure that all the
// cached relative matrices are correct.

View File

@ -415,7 +415,6 @@ write(ostream &out, int indent_level) const {
////////////////////////////////////////////////////////////////////
void EggVertexPool::
r_transform(const LMatrix4d &mat, const LMatrix4d &, CoordinateSystem) {
transform(mat);
}
////////////////////////////////////////////////////////////////////