More predictable mesh normals generation

This commit is contained in:
Eugene authored and Tim Angus committed 2022-03-21 18:07:23 +00:00
1 parent d77a7d4c90
commit 6d74896557
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -182,7 +182,7 @@ static int neighbors[8][2] = {
break; // edge of patch
}
VectorSubtract( ctrl[y][x].xyz, base, temp );
if ( VectorNormalize2( temp, temp ) == 0 ) {
if ( VectorNormalize( temp ) < 0.001f ) {
continue; // degenerate edge, get more dist
} else {
good[k] = qtrue;
@@ -198,7 +198,7 @@ static int neighbors[8][2] = {
continue; // didn't get two points
}
CrossProduct( around[(k+1)&7], around[k], normal );
if ( VectorNormalize2( normal, normal ) == 0 ) {
if ( VectorNormalize( normal ) < 0.001f ) {
continue;
}
VectorAdd( normal, sum, sum );
+2 -2
View File
@@ -182,7 +182,7 @@ static int neighbors[8][2] = {
break; // edge of patch
}
VectorSubtract( ctrl[y][x].xyz, base, temp );
if ( VectorNormalize2( temp, temp ) == 0 ) {
if ( VectorNormalize( temp ) < 0.001f ) {
continue; // degenerate edge, get more dist
} else {
good[k] = qtrue;
@@ -198,7 +198,7 @@ static int neighbors[8][2] = {
continue; // didn't get two points
}
CrossProduct( around[(k+1)&7], around[k], normal );
if ( VectorNormalize2( normal, normal ) == 0 ) {
if ( VectorNormalize( normal ) < 0.001f ) {
continue;
}
VectorAdd( normal, sum, sum );