diff options
Diffstat (limited to 'indra/newview/llface.cpp')
-rwxr-xr-x | indra/newview/llface.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 3e503cb750..f021f4ed0f 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -817,6 +817,12 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, size.mul(scale); } + // Catch potential badness from normalization before it happens + // + llassert(mat_normal.mMatrix[0].isFinite3() && (mat_normal.mMatrix[0].dot3(mat_normal.mMatrix[0]).getF32() > F_APPROXIMATELY_ZERO)); + llassert(mat_normal.mMatrix[1].isFinite3() && (mat_normal.mMatrix[1].dot3(mat_normal.mMatrix[1]).getF32() > F_APPROXIMATELY_ZERO)); + llassert(mat_normal.mMatrix[2].isFinite3() && (mat_normal.mMatrix[2].dot3(mat_normal.mMatrix[2]).getF32() > F_APPROXIMATELY_ZERO)); + mat_normal.mMatrix[0].normalize3fast(); mat_normal.mMatrix[1].normalize3fast(); mat_normal.mMatrix[2].normalize3fast(); @@ -1910,6 +1916,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, } binormal.normalize3fast(); + LLVector2 tc = bump_tc[i]; tc += LLVector2( bump_s_primary_light_ray.dot3(tangent).getF32(), bump_t_primary_light_ray.dot3(binormal).getF32() ); @@ -1996,7 +2003,6 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, LLFastTimer t(FTM_FACE_GEOM_NORMAL); mVertexBuffer->getNormalStrider(norm, mGeomIndex, mGeomCount, map_range); F32* normals = (F32*) norm.get(); - for (S32 i = 0; i < num_vertices; i++) { LLVector4a normal; @@ -2029,7 +2035,6 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, LLVector4a tangent_out; mat_normal.rotate(vf.mTangents[i], tangent_out); tangent_out.normalize3fast(); - tangent_out.setSelectWithMask(mask, vf.mTangents[i], tangent_out); tangent_out.store4a(tangents); @@ -2244,7 +2249,7 @@ BOOL LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) dist *= 16.f; } - lookAt.normalize3fast() ; + lookAt.normalize3fast(); //get area of circle around node F32 app_angle = atanf((F32) sqrt(size_squared) / dist); |