Parcourir la source

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

David Rose il y a 22 ans
Parent
commit
75762f560a

+ 5 - 3
panda/src/egg/eggData.cxx

@@ -283,9 +283,11 @@ set_coordinate_system(CoordinateSystem new_coordsys) {
   if (new_coordsys != _coordsys &&
   if (new_coordsys != _coordsys &&
       (_coordsys != CS_default && _coordsys != CS_invalid)) {
       (_coordsys != CS_default && _coordsys != CS_invalid)) {
     // Time to convert the data.
     // 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
     // Now we have to update the under_flags to ensure that all the
     // cached relative matrices are correct.
     // cached relative matrices are correct.

+ 1 - 1
panda/src/egg/eggGroup.cxx

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

+ 1 - 0
panda/src/egg/eggNode.I

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

+ 0 - 1
panda/src/egg/eggVertexPool.cxx

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