mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
More predictable mesh normals generation
This commit is contained in:
parent
d77a7d4c90
commit
6d74896557
2 changed files with 4 additions and 4 deletions
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue