fix texture projection decompilation

in C this check was equal to
abs((int)dist) >= distanceEpsilon
comparing float dist to distanceEpsilon is not sufficient, as points are not precise enough, plus they are snapped
This commit is contained in:
Garux 2021-01-25 08:36:16 +03:00
parent d0dcce342b
commit 3ff224cbdf

View File

@ -111,13 +111,14 @@ void GetBestSurfaceTriangleMatchForBrushside( side_t *buildSide, bspDrawVert_t *
continue;
}
}
if ( abs( DotProduct( vert[0]->xyz, buildPlane->normal ) - buildPlane->dist ) >= distanceEpsilon ) {
// fixme? better distance epsilon
if ( abs( DotProduct( vert[0]->xyz, buildPlane->normal ) - buildPlane->dist ) > 1 ) {
continue;
}
if ( abs( DotProduct( vert[1]->xyz, buildPlane->normal ) - buildPlane->dist ) >= distanceEpsilon ) {
if ( abs( DotProduct( vert[1]->xyz, buildPlane->normal ) - buildPlane->dist ) > 1 ) {
continue;
}
if ( abs( DotProduct( vert[2]->xyz, buildPlane->normal ) - buildPlane->dist ) >= distanceEpsilon ) {
if ( abs( DotProduct( vert[2]->xyz, buildPlane->normal ) - buildPlane->dist ) > 1 ) {
continue;
}
// Okay. Correct surface type, correct shader, correct plane. Let's start with the business...