diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/PrimMesher.cs | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/OpenSim/Region/Physics/Meshing/PrimMesher.cs b/OpenSim/Region/Physics/Meshing/PrimMesher.cs index 2a213c3..932943c 100644 --- a/OpenSim/Region/Physics/Meshing/PrimMesher.cs +++ b/OpenSim/Region/Physics/Meshing/PrimMesher.cs | |||
@@ -827,15 +827,16 @@ namespace PrimMesher | |||
827 | 827 | ||
828 | if (createFaces) | 828 | if (createFaces) |
829 | { | 829 | { |
830 | int numOuterVerts = this.coords.Count; | 830 | //int numOuterVerts = this.coords.Count; |
831 | int numHollowVerts = hollowCoords.Count; | 831 | //numOuterVerts = this.coords.Count; |
832 | int numTotalVerts = numOuterVerts + numHollowVerts; | 832 | //int numHollowVerts = hollowCoords.Count; |
833 | int numTotalVerts = this.numOuterVerts + this.numHollowVerts; | ||
833 | 834 | ||
834 | if (numOuterVerts == numHollowVerts) | 835 | if (this.numOuterVerts == this.numHollowVerts) |
835 | { | 836 | { |
836 | Face newFace = new Face(); | 837 | Face newFace = new Face(); |
837 | 838 | ||
838 | for (int coordIndex = 0; coordIndex < numOuterVerts - 1; coordIndex++) | 839 | for (int coordIndex = 0; coordIndex < this.numOuterVerts - 1; coordIndex++) |
839 | { | 840 | { |
840 | newFace.v1 = coordIndex; | 841 | newFace.v1 = coordIndex; |
841 | newFace.v2 = coordIndex + 1; | 842 | newFace.v2 = coordIndex + 1; |
@@ -850,12 +851,12 @@ namespace PrimMesher | |||
850 | } | 851 | } |
851 | else | 852 | else |
852 | { | 853 | { |
853 | if (numOuterVerts < numHollowVerts) | 854 | if (this.numOuterVerts < this.numHollowVerts) |
854 | { | 855 | { |
855 | Face newFace = new Face(); | 856 | Face newFace = new Face(); |
856 | int j = 0; // j is the index for outer vertices | 857 | int j = 0; // j is the index for outer vertices |
857 | int maxJ = numOuterVerts - 1; | 858 | int maxJ = this.numOuterVerts - 1; |
858 | for (int i = 0; i < numHollowVerts; i++) // i is the index for inner vertices | 859 | for (int i = 0; i < this.numHollowVerts; i++) // i is the index for inner vertices |
859 | { | 860 | { |
860 | if (j < maxJ) | 861 | if (j < maxJ) |
861 | if (angles.angles[j + 1].angle - hollowAngles.angles[i].angle < hollowAngles.angles[i].angle - angles.angles[j].angle + 0.000001f) | 862 | if (angles.angles[j + 1].angle - hollowAngles.angles[i].angle < hollowAngles.angles[i].angle - angles.angles[j].angle + 0.000001f) |
@@ -879,8 +880,8 @@ namespace PrimMesher | |||
879 | { | 880 | { |
880 | Face newFace = new Face(); | 881 | Face newFace = new Face(); |
881 | int j = 0; // j is the index for inner vertices | 882 | int j = 0; // j is the index for inner vertices |
882 | int maxJ = numHollowVerts - 1; | 883 | int maxJ = this.numHollowVerts - 1; |
883 | for (int i = 0; i < numOuterVerts; i++) | 884 | for (int i = 0; i < this.numOuterVerts; i++) |
884 | { | 885 | { |
885 | if (j < maxJ) | 886 | if (j < maxJ) |
886 | if (hollowAngles.angles[j + 1].angle - angles.angles[i].angle < angles.angles[i].angle - hollowAngles.angles[j].angle + 0.000001f) | 887 | if (hollowAngles.angles[j + 1].angle - angles.angles[i].angle < angles.angles[i].angle - hollowAngles.angles[j].angle + 0.000001f) |
@@ -981,7 +982,7 @@ namespace PrimMesher | |||
981 | int startVert = hasProfileCut && !hasHollow ? 1 : 0; | 982 | int startVert = hasProfileCut && !hasHollow ? 1 : 0; |
982 | if (startVert > 0) | 983 | if (startVert > 0) |
983 | this.faceNumbers.Add(-1); | 984 | this.faceNumbers.Add(-1); |
984 | for (int i = 0; i < numOuterVerts - 1; i++) | 985 | for (int i = 0; i < this.numOuterVerts - 1; i++) |
985 | this.faceNumbers.Add(sides < 5 ? faceNum++ : faceNum); | 986 | this.faceNumbers.Add(sides < 5 ? faceNum++ : faceNum); |
986 | 987 | ||
987 | //if (!hasHollow && !hasProfileCut) | 988 | //if (!hasHollow && !hasProfileCut) |
@@ -994,7 +995,7 @@ namespace PrimMesher | |||
994 | 995 | ||
995 | if (hasHollow) | 996 | if (hasHollow) |
996 | { | 997 | { |
997 | for (int i = 0; i < numHollowVerts; i++) | 998 | for (int i = 0; i < this.numHollowVerts; i++) |
998 | this.faceNumbers.Add(faceNum); | 999 | this.faceNumbers.Add(faceNum); |
999 | 1000 | ||
1000 | faceNum++; | 1001 | faceNum++; |
@@ -1019,7 +1020,7 @@ namespace PrimMesher | |||
1019 | { | 1020 | { |
1020 | this.faceUVs = new List<UVCoord>(); | 1021 | this.faceUVs = new List<UVCoord>(); |
1021 | foreach (Coord c in this.coords) | 1022 | foreach (Coord c in this.coords) |
1022 | this.faceUVs.Add(new UVCoord(1.0f - (0.5f + c.X), 1.0f - (0.5f - c.Y))); | 1023 | this.faceUVs.Add(new UVCoord(0.5f + c.X, 0.5f - c.Y)); |
1023 | } | 1024 | } |
1024 | 1025 | ||
1025 | internal Profile Copy() | 1026 | internal Profile Copy() |
@@ -1348,7 +1349,6 @@ namespace PrimMesher | |||
1348 | float stepSize = twoPi / this.stepsPerRevolution; | 1349 | float stepSize = twoPi / this.stepsPerRevolution; |
1349 | 1350 | ||
1350 | int step = (int)(startAngle / stepSize); | 1351 | int step = (int)(startAngle / stepSize); |
1351 | // int firstStep = step; | ||
1352 | float angle = startAngle; | 1352 | float angle = startAngle; |
1353 | 1353 | ||
1354 | bool done = false; | 1354 | bool done = false; |
@@ -1738,7 +1738,6 @@ namespace PrimMesher | |||
1738 | // append this layer | 1738 | // append this layer |
1739 | 1739 | ||
1740 | int coordsLen = this.coords.Count; | 1740 | int coordsLen = this.coords.Count; |
1741 | // int lastCoordsLen = coordsLen; | ||
1742 | newLayer.AddValue2FaceVertexIndices(coordsLen); | 1741 | newLayer.AddValue2FaceVertexIndices(coordsLen); |
1743 | 1742 | ||
1744 | this.coords.AddRange(newLayer.coords); | 1743 | this.coords.AddRange(newLayer.coords); |