Selaa lähdekoodia

Update Camera.project_position to not return get_global_transform().origin if projection mode is orthogonal

SIYU FU 5 vuotta sitten
vanhempi
commit
d80e979a48
1 muutettua tiedostoa jossa 1 lisäystä ja 2 poistoa
  1. 1 2
      scene/3d/camera.cpp

+ 1 - 2
scene/3d/camera.cpp

@@ -390,10 +390,9 @@ Vector3 Camera::project_position(const Point2 &p_point, float p_z_depth) const {
 
 	ERR_FAIL_COND_V_MSG(!is_inside_tree(), Vector3(), "Camera is not inside scene.");
 
-	if (p_z_depth == 0) {
+	if (p_z_depth == 0 && mode != PROJECTION_ORTHOGONAL) {
 		return get_global_transform().origin;
 	}
-
 	Size2 viewport_size = get_viewport()->get_visible_rect().size;
 
 	CameraMatrix cm;