mirror of
https://github.com/microsoft/UVAtlas
synced 2024-11-08 13:20:06 +00:00
guard against a potential divide-by-zero with degenerate faces
This commit is contained in:
parent
f489e12d7e
commit
0fbcfb3a99
@ -323,7 +323,8 @@ HRESULT CBaseMeshInfo::ComputeInputFaceAttributes(
|
||||
|
||||
pfFaceAreaArray[i] = area * 0.5f;
|
||||
fMeshArea += pfFaceAreaArray[i];
|
||||
vFaceNormal /= area;
|
||||
if ( area > 0.f )
|
||||
vFaceNormal /= area;
|
||||
XMStoreFloat3(pFaceNormal, vFaceNormal);
|
||||
|
||||
if (pFaceCanonicalUVCoordinate)
|
||||
|
Loading…
Reference in New Issue
Block a user