Bladeren bron

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

David Rose 22 jaren geleden
bovenliggende
commit
75762f560a
4 gewijzigde bestanden met toevoegingen van 7 en 5 verwijderingen
  1. 5 3
      panda/src/egg/eggData.cxx
  2. 1 1
      panda/src/egg/eggGroup.cxx
  3. 1 0
      panda/src/egg/eggNode.I
  4. 0 1
      panda/src/egg/eggVertexPool.cxx

+ 5 - 3
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.

+ 1 - 1
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

+ 1 - 0
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.

+ 0 - 1
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);
 }
 
 ////////////////////////////////////////////////////////////////////