diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/llprimitive/llmodel.cpp | 15 | 
1 files changed, 14 insertions, 1 deletions
| diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 986bde0581..ba7abd4c79 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1209,10 +1209,23 @@ void LLModel::generateNormals(F32 angle_cutoff)  			LLVolumeFace::VertexData v;  			new_face.mPositions[i] = vol_face.mPositions[idx];  			new_face.mNormals[i].clear(); -			new_face.mTexCoords[i] = vol_face.mTexCoords[idx];  			new_face.mIndices[i] = i;  		} +		if (vol_face.mTexCoords) +		{ +			for (U32 i = 0; i < vol_face.mNumIndices; i++) +			{ +				U32 idx = vol_face.mIndices[i]; +				new_face.mTexCoords[i] = vol_face.mTexCoords[idx]; +			} +		} +		else +		{ +			ll_aligned_free_16(new_face.mTexCoords); +			new_face.mTexCoords = NULL; +		} +  		//generate normals for new face  		for (U32 i = 0; i < new_face.mNumIndices; i += 3)  		{ //for each triangle | 
