X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_skate.c;h=a89783c7e15ef669355b154114b2ea6aa7a0ebcd;hb=77c64b6f11663f59bc5753e4bade5bc165d36ca6;hp=4688702a68385f01c8d95b68bbc9dffcab278cdf;hpb=6ba5c35d106d749a1ebafbd3cbe18c3a02f781d3;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_skate.c b/player_skate.c index 4688702..a89783c 100644 --- a/player_skate.c +++ b/player_skate.c @@ -181,8 +181,7 @@ too_many_samples: if( sample_count < 2 ) return 0; - v3f - average_direction, + v3f average_direction, average_normal; v2f min_co, max_co; @@ -227,6 +226,10 @@ too_many_samples: v3_copy( si->normal3, n0 ); v3_copy( sj->normal3, n1 ); v3_cross( n0, n1, dir ); + + if( v3_length2( dir ) <= 0.001f ) + continue; + v3_normalize( dir ); /* make sure the directions all face a common hemisphere */