diff --git a/panda/src/egg/eggData.cxx b/panda/src/egg/eggData.cxx index 2d1eaf1042..063c7af2eb 100644 --- a/panda/src/egg/eggData.cxx +++ b/panda/src/egg/eggData.cxx @@ -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. diff --git a/panda/src/egg/eggGroup.cxx b/panda/src/egg/eggGroup.cxx index cdb74e6a17..a6a1fa6b34 100644 --- a/panda/src/egg/eggGroup.cxx +++ b/panda/src/egg/eggGroup.cxx @@ -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 diff --git a/panda/src/egg/eggNode.I b/panda/src/egg/eggNode.I index e44d655ec4..15ff029197 100644 --- a/panda/src/egg/eggNode.I +++ b/panda/src/egg/eggNode.I @@ -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. diff --git a/panda/src/egg/eggVertexPool.cxx b/panda/src/egg/eggVertexPool.cxx index 9172ba638b..5d73721c30 100644 --- a/panda/src/egg/eggVertexPool.cxx +++ b/panda/src/egg/eggVertexPool.cxx @@ -415,7 +415,6 @@ write(ostream &out, int indent_level) const { //////////////////////////////////////////////////////////////////// void EggVertexPool:: r_transform(const LMatrix4d &mat, const LMatrix4d &, CoordinateSystem) { - transform(mat); } ////////////////////////////////////////////////////////////////////