瀏覽代碼

fix bug with set_coordinate_system not updating right away

David Rose 24 年之前
父節點
當前提交
19df0046de
共有 2 個文件被更改,包括 8 次插入0 次删除
  1. 4 0
      panda/src/egg/eggData.cxx
  2. 4 0
      panda/src/egg/eggNode.I

+ 4 - 0
panda/src/egg/eggData.cxx

@@ -232,6 +232,10 @@ set_coordinate_system(CoordinateSystem new_coordsys) {
     r_transform(LMatrix4d::convert_mat(_coordsys, new_coordsys),
     r_transform(LMatrix4d::convert_mat(_coordsys, new_coordsys),
                 LMatrix4d::convert_mat(new_coordsys, _coordsys),
                 LMatrix4d::convert_mat(new_coordsys, _coordsys),
                 new_coordsys);
                 new_coordsys);
+
+    // Now we have to update the under_flags to ensure that all the
+    // cached relative matrices are correct.
+    update_under(0);
   }
   }
 
 
   _coordsys = new_coordsys;
   _coordsys = new_coordsys;

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

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