diff options
Diffstat (limited to 'scene/resources/surface_tool.cpp')
-rw-r--r-- | scene/resources/surface_tool.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index 653f234d3d..06d53e4e2f 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -97,6 +97,10 @@ bool SurfaceTool::Vertex::operator==(const Vertex &p_vertex) const { return false; } + if (tangent != p_vertex.tangent) { + return false; + } + if (color != p_vertex.color) { return false; } @@ -880,9 +884,9 @@ void SurfaceTool::create_vertex_array_from_triangle_arrays(const Array &p_arrays v.normal = narr[i]; } 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.tangent = Vector3(tarr[i * 4 + 0], tarr[i * 4 + 1], tarr[i * 4 + 2]); + float d = tarr[i * 4 + 3]; + v.binormal = v.normal.cross(v.tangent).normalized() * d; } if (lformat & RS::ARRAY_FORMAT_COLOR) { v.color = carr[i]; |