From 9cb31845bafe9188d9f90dc1330355c73fb96851 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 4 May 2011 20:45:14 -0500 Subject: SH-1497 Update mesh asset parser to use new format restrictions. --- indra/llmath/llvolume.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/llmath') diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 70e1e1f312..c44c95272e 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2239,13 +2239,12 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) } - LLVector3 minp; - LLVector3 maxp; + LLVector3 minp(-0.5f, -0.5f, -0.5f); + LLVector3 maxp(0.5f, 0.5f, 0.5f); LLVector2 min_tc; LLVector2 max_tc; - minp.setValue(mdl[i]["PositionDomain"]["Min"]); - maxp.setValue(mdl[i]["PositionDomain"]["Max"]); + LLVector4a min_pos, max_pos; min_pos.load3(minp.mV); max_pos.load3(maxp.mV); -- cgit v1.2.3 From aa21ad59aa1540be1839f0403b5a1291b86a74b3 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 6 Jun 2011 18:20:07 -0500 Subject: Fix for crash when viewing asset with "NoGeometry" --- indra/llmath/llvolume.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/llmath') diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 3c1de3a422..f473a708cd 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2419,12 +2419,25 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) for (U32 i = 0; i < face_count; ++i) { + LLVolumeFace& face = mVolumeFaces[i]; + + if (mdl[i].has("NoGeometry")) + { //face has no geometry, continue + face.resizeIndices(3); + face.resizeVertices(1); + memset(face.mPositions, 0, sizeof(LLVector4a)); + memset(face.mNormals, 0, sizeof(LLVector4a)); + memset(face.mTexCoords, 0, sizeof(LLVector2)); + memset(face.mIndices, 0, sizeof(U16)*3); + continue; + } + LLSD::Binary pos = mdl[i]["Position"]; LLSD::Binary norm = mdl[i]["Normal"]; LLSD::Binary tc = mdl[i]["TexCoord0"]; LLSD::Binary idx = mdl[i]["TriangleList"]; - LLVolumeFace& face = mVolumeFaces[i]; + //copy out indices face.resizeIndices(idx.size()/2); -- cgit v1.2.3