diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-10 16:47:11 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-10 16:47:11 +0200 |
| commit | 94721f5ab8af9e7d91a4de58baf2c8d849ceab6e (patch) | |
| tree | 92fb34d709310b76de1c2d45cfe2aad8db7a523a /scene/resources/surface_tool.cpp | |
| parent | 6ab92464bc6356f3342c3efd1fc1bb1a5e4467d5 (diff) | |
| download | redot-engine-94721f5ab8af9e7d91a4de58baf2c8d849ceab6e.tar.gz | |
Revert "Renamed plane's d to distance"
This reverts commit ec7b481170dcd6a7b4cf0e6c1221e204ff7945f3.
This was wrong, `d` is not a distance but the `d` constant in the
parametric equation `ax + by + cz = d` describing the plane.
Diffstat (limited to 'scene/resources/surface_tool.cpp')
| -rw-r--r-- | scene/resources/surface_tool.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index c5e1aa7c80..4b392e23b7 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.distance; + vtx.binormal = last_normal.cross(last_tangent.normal).normalized() * last_tangent.d; 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.distance; + v.binormal = p.normal.cross(v.tangent).normalized() * p.d; } 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.distance; + v.binormal = p.normal.cross(v.tangent).normalized() * p.d; } if (lformat & RS::ARRAY_FORMAT_COLOR) v.color = carr[i]; |
