summaryrefslogtreecommitdiff
path: root/indra/llprimitive
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-08-26 18:36:25 -0500
committerDave Parks <davep@lindenlab.com>2010-08-26 18:36:25 -0500
commit771195865c4fb336f573025e9a7a22313bfb6cb8 (patch)
treebb2434d62bebe961b7038b6e435cb3710d8a6736 /indra/llprimitive
parente763cb13b7e901eba0d5a8d6671222c31f6fd632 (diff)
CTS-219 Fix for broken geometry when importing from polygons.
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/llmodel.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 82765c740f..e4b7cd80ce 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -662,12 +662,18 @@ void load_face_from_dom_polygons(std::vector<LLVolumeFace>& face_list, std::vect
}
}
+ if (cur_idx != vert_idx.size())
+ {
+ llerrs << "WTF?" << llendl;
+ }
+
//build vertex array from map
- verts.resize(vert_idx.size());
+ std::vector<LLVolumeFace::VertexData> new_verts;
+ new_verts.resize(vert_idx.size());
for (std::map<LLVolumeFace::VertexData, U32>::iterator iter = vert_idx.begin(); iter != vert_idx.end(); ++iter)
{
- verts[iter->second] = iter->first;
+ new_verts[iter->second] = iter->first;
update_min_max(face.mExtents[0], face.mExtents[1], iter->first.getPosition());
}
@@ -679,8 +685,14 @@ void load_face_from_dom_polygons(std::vector<LLVolumeFace>& face_list, std::vect
indices[i] = vert_idx[verts[i]];
}
+ // DEBUG just build an expanded triangle list
+ /*for (U32 i = 0; i < verts.size(); ++i)
+ {
+ indices.push_back((U16) i);
+ update_min_max(face.mExtents[0], face.mExtents[1], verts[i].getPosition());
+ }*/
- if (!verts.empty())
+ if (!new_verts.empty())
{
std::string material;
@@ -691,7 +703,7 @@ void load_face_from_dom_polygons(std::vector<LLVolumeFace>& face_list, std::vect
materials.push_back(material);
face_list.push_back(face);
- face_list.rbegin()->fillFromLegacyData(verts, indices);
+ face_list.rbegin()->fillFromLegacyData(new_verts, indices);
}
}