diff options
author | Marcus Elg <marcusaccounts@yahoo.se> | 2020-05-10 09:00:10 +0200 |
---|---|---|
committer | Marcus Elg <marcusaccounts@yahoo.se> | 2020-05-10 12:12:51 +0200 |
commit | ec7b481170dcd6a7b4cf0e6c1221e204ff7945f3 (patch) | |
tree | bd054639c909ab4ea6c855e70ddc3b25ee2f50b0 /scene | |
parent | ff5dfcdf68c20590bf123ade75ca06ed58276372 (diff) |
Renamed plane's d to distance
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/camera_3d.cpp | 2 | ||||
-rw-r--r-- | scene/3d/xr_nodes.cpp | 2 | ||||
-rw-r--r-- | scene/resources/curve.cpp | 4 | ||||
-rw-r--r-- | scene/resources/mesh.cpp | 2 | ||||
-rw-r--r-- | scene/resources/mesh_data_tool.cpp | 2 | ||||
-rw-r--r-- | scene/resources/surface_tool.cpp | 6 | ||||
-rw-r--r-- | scene/resources/world_margin_shape_3d.cpp | 12 |
7 files changed, 15 insertions, 15 deletions
diff --git a/scene/3d/camera_3d.cpp b/scene/3d/camera_3d.cpp index 871f3119bc..7d02befee6 100644 --- a/scene/3d/camera_3d.cpp +++ b/scene/3d/camera_3d.cpp @@ -376,7 +376,7 @@ Point2 Camera3D::unproject_position(const Vector3 &p_pos) const { Plane p(get_camera_transform().xform_inv(p_pos), 1.0); p = cm.xform4(p); - p.normal /= p.d; + p.normal /= p.distance; Point2 res; res.x = (p.normal.x * 0.5 + 0.5) * viewport_size.x; diff --git a/scene/3d/xr_nodes.cpp b/scene/3d/xr_nodes.cpp index 6f41629bac..05e282533b 100644 --- a/scene/3d/xr_nodes.cpp +++ b/scene/3d/xr_nodes.cpp @@ -111,7 +111,7 @@ Point2 XRCamera3D::unproject_position(const Vector3 &p_pos) const { Plane p(get_camera_transform().xform_inv(p_pos), 1.0); p = cm.xform4(p); - p.normal /= p.d; + p.normal /= p.distance; Point2 res; res.x = (p.normal.x * 0.5 + 0.5) * viewport_size.x; diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index ae705a47e8..d96013a081 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -1237,7 +1237,7 @@ void Curve3D::_bake() const { p = mid; Plane post; post.normal = pos; - post.d = Math::lerp(points[i].tilt, points[i + 1].tilt, mid); + post.distance = Math::lerp(points[i].tilt, points[i + 1].tilt, mid); pointlist.push_back(post); } else { @@ -1274,7 +1274,7 @@ void Curve3D::_bake() const { for (List<Plane>::Element *E = pointlist.front(); E; E = E->next()) { w[idx] = E->get().normal; - wt[idx] = E->get().d; + wt[idx] = E->get().distance; if (!up_vector_enabled) { idx++; diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 401b689145..adecf5cf8f 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -1522,7 +1522,7 @@ Error ArrayMesh::lightmap_unwrap_cached(int *&r_cache_data, unsigned int &r_cach if (lightmap_surfaces[surface].format & ARRAY_FORMAT_TANGENT) { Plane t; t.normal = v.tangent; - t.d = v.binormal.dot(v.normal.cross(v.tangent)) < 0 ? -1 : 1; + t.distance = v.binormal.dot(v.normal.cross(v.tangent)) < 0 ? -1 : 1; surfaces_tools.write[surface]->add_tangent(t); } if (lightmap_surfaces[surface].format & ARRAY_FORMAT_BONES) { diff --git a/scene/resources/mesh_data_tool.cpp b/scene/resources/mesh_data_tool.cpp index 76d96786bc..e4d402479f 100644 --- a/scene/resources/mesh_data_tool.cpp +++ b/scene/resources/mesh_data_tool.cpp @@ -255,7 +255,7 @@ Error MeshDataTool::commit_to_surface(const Ref<ArrayMesh> &p_mesh) { ta[i * 4 + 0] = vtx.tangent.normal.x; ta[i * 4 + 1] = vtx.tangent.normal.y; ta[i * 4 + 2] = vtx.tangent.normal.z; - ta[i * 4 + 3] = vtx.tangent.d; + ta[i * 4 + 3] = vtx.tangent.distance; } if (uv) uv[i] = vtx.uv; diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index 4b392e23b7..c5e1aa7c80 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -107,7 +107,7 @@ void SurfaceTool::add_vertex(const Vector3 &p_vertex) { vtx.weights = last_weights; vtx.bones = last_bones; vtx.tangent = last_tangent.normal; - vtx.binormal = last_normal.cross(last_tangent.normal).normalized() * last_tangent.d; + vtx.binormal = last_normal.cross(last_tangent.normal).normalized() * last_tangent.distance; const int expected_vertices = 4; @@ -575,7 +575,7 @@ Vector<SurfaceTool::Vertex> SurfaceTool::create_vertex_array_from_triangle_array if (lformat & RS::ARRAY_FORMAT_TANGENT) { Plane p(tarr[i * 4 + 0], tarr[i * 4 + 1], tarr[i * 4 + 2], tarr[i * 4 + 3]); v.tangent = p.normal; - v.binormal = p.normal.cross(v.tangent).normalized() * p.d; + v.binormal = p.normal.cross(v.tangent).normalized() * p.distance; } if (lformat & RS::ARRAY_FORMAT_COLOR) v.color = carr[i]; @@ -658,7 +658,7 @@ void SurfaceTool::_create_list_from_arrays(Array arr, List<Vertex> *r_vertex, Li if (lformat & RS::ARRAY_FORMAT_TANGENT) { Plane p(tarr[i * 4 + 0], tarr[i * 4 + 1], tarr[i * 4 + 2], tarr[i * 4 + 3]); v.tangent = p.normal; - v.binormal = p.normal.cross(v.tangent).normalized() * p.d; + v.binormal = p.normal.cross(v.tangent).normalized() * p.distance; } if (lformat & RS::ARRAY_FORMAT_COLOR) v.color = carr[i]; diff --git a/scene/resources/world_margin_shape_3d.cpp b/scene/resources/world_margin_shape_3d.cpp index aa96f8aa68..833e7725ae 100644 --- a/scene/resources/world_margin_shape_3d.cpp +++ b/scene/resources/world_margin_shape_3d.cpp @@ -41,10 +41,10 @@ Vector<Vector3> WorldMarginShape3D::get_debug_mesh_lines() { Vector3 n2 = p.normal.cross(n1).normalized(); Vector3 pface[4] = { - p.normal * p.d + n1 * 10.0 + n2 * 10.0, - p.normal * p.d + n1 * 10.0 + n2 * -10.0, - p.normal * p.d + n1 * -10.0 + n2 * -10.0, - p.normal * p.d + n1 * -10.0 + n2 * 10.0, + p.normal * p.distance + n1 * 10.0 + n2 * 10.0, + p.normal * p.distance + n1 * 10.0 + n2 * -10.0, + p.normal * p.distance + n1 * -10.0 + n2 * -10.0, + p.normal * p.distance + n1 * -10.0 + n2 * 10.0, }; points.push_back(pface[0]); @@ -55,8 +55,8 @@ Vector<Vector3> WorldMarginShape3D::get_debug_mesh_lines() { points.push_back(pface[3]); points.push_back(pface[3]); points.push_back(pface[0]); - points.push_back(p.normal * p.d); - points.push_back(p.normal * p.d + p.normal * 3); + points.push_back(p.normal * p.distance); + points.push_back(p.normal * p.distance + p.normal * 3); return points; } |