aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDahlia Trimble2009-07-11 04:53:41 +0000
committerDahlia Trimble2009-07-11 04:53:41 +0000
commit3f2ee8915dc514b4a216331dfaf7e5dbb039f99a (patch)
tree6ec0f85f023395ac0c7d2e6aa28213b6a5527e19 /OpenSim
parent* Added a user friendly message to the sqlite regionsettings saver giving the... (diff)
downloadopensim-SC_OLD-3f2ee8915dc514b4a216331dfaf7e5dbb039f99a.zip
opensim-SC_OLD-3f2ee8915dc514b4a216331dfaf7e5dbb039f99a.tar.gz
opensim-SC_OLD-3f2ee8915dc514b4a216331dfaf7e5dbb039f99a.tar.bz2
opensim-SC_OLD-3f2ee8915dc514b4a216331dfaf7e5dbb039f99a.tar.xz
Some improvements to prim face numbering - only affects viewers using PrimMesher
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Physics/Meshing/PrimMesher.cs28
1 files changed, 17 insertions, 11 deletions
diff --git a/OpenSim/Region/Physics/Meshing/PrimMesher.cs b/OpenSim/Region/Physics/Meshing/PrimMesher.cs
index 56534cf..8c6bd2b 100644
--- a/OpenSim/Region/Physics/Meshing/PrimMesher.cs
+++ b/OpenSim/Region/Physics/Meshing/PrimMesher.cs
@@ -910,25 +910,31 @@ namespace PrimMesher
910 910
911 if (calcVertexNormals) 911 if (calcVertexNormals)
912 { // calculate prim face numbers 912 { // calculate prim face numbers
913
914 // face number order is top, outer, hollow, bottom, start cut, end cut
913 // I know it's ugly but so is the whole concept of prim face numbers 915 // I know it's ugly but so is the whole concept of prim face numbers
914 int faceNum = 1; 916
917 int faceNum = 1; // start with outer faces
915 int startVert = hasProfileCut && !hasHollow ? 1 : 0; 918 int startVert = hasProfileCut && !hasHollow ? 1 : 0;
916 if (startVert > 0) 919 if (startVert > 0)
917 this.faceNumbers.Add(0); 920 this.faceNumbers.Add(-1);
918 for (int i = 0; i < numOuterVerts; i++) 921 for (int i = 0; i < numOuterVerts - 1; i++)
919 this.faceNumbers.Add(sides < 5 ? faceNum++ : faceNum); 922 this.faceNumbers.Add(sides < 5 ? faceNum++ : faceNum);
923 this.faceNumbers.Add(hasProfileCut ? -1 : faceNum++);
920 if (sides > 4) 924 if (sides > 4)
921 faceNum++; 925 faceNum++;
922 if (hasProfileCut) 926 if (hasHollow)
923 this.faceNumbers.Add(0); 927 {
924 for (int i = 0; i < numHollowVerts; i++) 928 for (int i = 0; i < numHollowVerts; i++)
925 //this.faceNumbers.Add(faceNum++); 929 this.faceNumbers.Add(faceNum);
926 this.faceNumbers.Add(hollowSides < 5 ? faceNum++ : faceNum); 930
931 faceNum++;
932 }
927 this.bottomFaceNumber = faceNum++; 933 this.bottomFaceNumber = faceNum++;
928 if (hasHollow && hasProfileCut) 934 if (hasHollow && hasProfileCut)
929 this.faceNumbers.Add(faceNum++); 935 this.faceNumbers.Add(faceNum++);
930 for (int i = 0; i < this.faceNumbers.Count; i++) 936 for (int i = 0; i < this.faceNumbers.Count; i++)
931 if (this.faceNumbers[i] == 0) 937 if (this.faceNumbers[i] == -1)
932 this.faceNumbers[i] = faceNum++; 938 this.faceNumbers[i] = faceNum++;
933 939
934 this.numPrimFaces = faceNum; 940 this.numPrimFaces = faceNum;
@@ -1373,7 +1379,7 @@ namespace PrimMesher
1373 if (this.viewerMode) 1379 if (this.viewerMode)
1374 { 1380 {
1375 Coord faceNormal = newLayer.faceNormal; 1381 Coord faceNormal = newLayer.faceNormal;
1376 ViewerFace newViewerFace = new ViewerFace(0); 1382 ViewerFace newViewerFace = new ViewerFace(profile.bottomFaceNumber);
1377 int numFaces = newLayer.faces.Count; 1383 int numFaces = newLayer.faces.Count;
1378 List<Face> faces = newLayer.faces; 1384 List<Face> faces = newLayer.faces;
1379 1385
@@ -1568,7 +1574,7 @@ namespace PrimMesher
1568 // add the top faces to the viewerFaces list here 1574 // add the top faces to the viewerFaces list here
1569 Coord faceNormal = newLayer.faceNormal; 1575 Coord faceNormal = newLayer.faceNormal;
1570 ViewerFace newViewerFace = new ViewerFace(); 1576 ViewerFace newViewerFace = new ViewerFace();
1571 newViewerFace.primFaceNumber = newLayer.bottomFaceNumber; 1577 newViewerFace.primFaceNumber = 0;
1572 int numFaces = newLayer.faces.Count; 1578 int numFaces = newLayer.faces.Count;
1573 List<Face> faces = newLayer.faces; 1579 List<Face> faces = newLayer.faces;
1574 1580