summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-11-10 00:12:18 +0100
committerRémi Verschelde <rverschelde@gmail.com>2019-11-10 00:17:26 +0100
commit6c557b8bdfc0f9b9080fa40b72c891bbca11679f (patch)
tree0ab448623696b02f3530b1f9acf40251ad907e9f /scene
parent94f00eb6c5323dff933a4985b60e8ebf9391f940 (diff)
Camera: Don't set default value for project_position
A z_depth of 0 returns the camera position, which is not really useful. This also makes the API breakage from 3.1 clearer as 3.1 code will now fail to compile, so users will have to adapt and use the new parameter. For the reference, in 3.1, the z_depth was hardcoded to the near plane. Closes #33493.
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/arvr_nodes.h2
-rw-r--r--scene/3d/camera.cpp2
-rw-r--r--scene/3d/camera.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/scene/3d/arvr_nodes.h b/scene/3d/arvr_nodes.h
index 8e735f7110..b647df70aa 100644
--- a/scene/3d/arvr_nodes.h
+++ b/scene/3d/arvr_nodes.h
@@ -55,7 +55,7 @@ public:
virtual Vector3 project_local_ray_normal(const Point2 &p_pos) const;
virtual Point2 unproject_position(const Vector3 &p_pos) const;
- virtual Vector3 project_position(const Point2 &p_point, float p_z_depth = 0) const;
+ virtual Vector3 project_position(const Point2 &p_point, float p_z_depth) const;
virtual Vector<Plane> get_frustum() const;
ARVRCamera();
diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp
index 9797b5f3ab..4d9bb69778 100644
--- a/scene/3d/camera.cpp
+++ b/scene/3d/camera.cpp
@@ -486,7 +486,7 @@ void Camera::_bind_methods() {
ClassDB::bind_method(D_METHOD("project_ray_origin", "screen_point"), &Camera::project_ray_origin);
ClassDB::bind_method(D_METHOD("unproject_position", "world_point"), &Camera::unproject_position);
ClassDB::bind_method(D_METHOD("is_position_behind", "world_point"), &Camera::is_position_behind);
- ClassDB::bind_method(D_METHOD("project_position", "screen_point", "z_depth"), &Camera::project_position, DEFVAL(0));
+ ClassDB::bind_method(D_METHOD("project_position", "screen_point", "z_depth"), &Camera::project_position);
ClassDB::bind_method(D_METHOD("set_perspective", "fov", "z_near", "z_far"), &Camera::set_perspective);
ClassDB::bind_method(D_METHOD("set_orthogonal", "size", "z_near", "z_far"), &Camera::set_orthogonal);
ClassDB::bind_method(D_METHOD("set_frustum", "size", "offset", "z_near", "z_far"), &Camera::set_frustum);
diff --git a/scene/3d/camera.h b/scene/3d/camera.h
index 22223880c1..d81e097fc5 100644
--- a/scene/3d/camera.h
+++ b/scene/3d/camera.h
@@ -142,7 +142,7 @@ public:
virtual Vector3 project_local_ray_normal(const Point2 &p_pos) const;
virtual Point2 unproject_position(const Vector3 &p_pos) const;
bool is_position_behind(const Vector3 &p_pos) const;
- virtual Vector3 project_position(const Point2 &p_point, float p_z_depth = 0) const;
+ virtual Vector3 project_position(const Point2 &p_point, float p_z_depth) const;
Vector<Vector3> get_near_plane_points() const;