guard against a potential divide-by-zero with degenerate faces

This commit is contained in:
walbourn_cp 2014-11-21 17:43:36 -08:00
parent f489e12d7e
commit 0fbcfb3a99

View File

@ -323,6 +323,7 @@ HRESULT CBaseMeshInfo::ComputeInputFaceAttributes(
pfFaceAreaArray[i] = area * 0.5f;
fMeshArea += pfFaceAreaArray[i];
if ( area > 0.f )
vFaceNormal /= area;
XMStoreFloat3(pFaceNormal, vFaceNormal);