瀏覽代碼

bring near plane back when necessary

David Rose 23 年之前
父節點
當前提交
77302eaf47
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      panda/src/framework/windowFramework.cxx

+ 4 - 0
panda/src/framework/windowFramework.cxx

@@ -286,6 +286,10 @@ center_trackball(const NodePath &object) {
     // Ensure the far plane is far enough back to see the entire object.
     float ideal_far_plane = distance + radius;
     lens->set_far(max(lens->get_default_far(), ideal_far_plane)); 
+
+    // And that the near plane is far enough forward.
+    float ideal_near_plane = distance - radius;
+    lens->set_near(min(lens->get_default_near(), ideal_near_plane)); 
   }
 
   _trackball->set_origin(center);