Fix T98718: Face Is Planar Node Not handling Certain Conditions

The comparison between dot products of each point of the poly were
not taking into consideration negative values. FLT_MIN was used rather
than -FLT_MAX due to a misunderstanding of the FLT_MIN definition.

Maniphest Tasks: T98718

Differential Revision: https://developer.blender.org/D15161
This commit is contained in:
Johnny Matthews 2022-06-14 12:53:50 -05:00 committed by Philipp Oeser
parent 455d227831
commit 09501c1215
Notes: blender-bot 2023-02-14 02:43:21 +01:00
Referenced by issue #98718, Face Is Planar Node: Rotating a plane makes it non-planar
Referenced by issue #98661, 3.2: Potential candidates for corrective releases
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ class PlanarFieldInput final : public GeometryFieldInput {
float3 reference_normal = poly_normals[i_poly];
float min = FLT_MAX;
float max = FLT_MIN;
float max = -FLT_MAX;
for (const int i_loop : poly_loops.index_range()) {
const float3 vert = mesh->mvert[poly_loops[i_loop].v].co;