Skip to content

Commit

Permalink
Update Camera.project_position to not return get_global_transform().o…
Browse files Browse the repository at this point in the history
…rigin if projection mode is orthogonal
  • Loading branch information
fsy98 committed Dec 11, 2019
1 parent 6c3e145 commit 6229f6f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scene/3d/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6229f6f

Please sign in to comment.