Small corrections to dmap

This commit is contained in:
Robert Beckebans 2014-08-02 15:09:25 +02:00
parent 352df659a8
commit e03ed8769d
10 changed files with 70 additions and 35 deletions

View file

@ -189,17 +189,19 @@ static bool MatchVert( const idDrawVert* a, const idDrawVert* b )
return false;
}
// RB begin
// if the normal is 0 (smoothed normals), consider it a match
if( a->GetNormal() == idVec3( 0, 0, 0 ) || b->GetNormal() == idVec3( 0, 0, 0 ) )
if( a->GetNormal().Length() == 0 && b->GetNormal().Length() == 0 )
{
return true;
}
// otherwise do a dot-product cosine check
if( a->GetNormal() * b->GetNormal() < COSINE_EPSILON )
if( ( a->GetNormal() * b->GetNormal() ) < COSINE_EPSILON )
{
return false;
}
// RB end
return true;
}