diff options
Diffstat (limited to 'OpenSim/Region/Physics/Meshing/Meshmerizer.cs')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 7cf8b76..ecde92a 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -1971,21 +1971,39 @@ namespace OpenSim.Region.Physics.Meshing | |||
1971 | 1971 | ||
1972 | primMesh.Scale(size.X, size.Y, size.Z); | 1972 | primMesh.Scale(size.X, size.Y, size.Z); |
1973 | 1973 | ||
1974 | int numCoords = primMesh.coords.Count; | ||
1974 | int numFaces = primMesh.faces.Count; | 1975 | int numFaces = primMesh.faces.Count; |
1976 | |||
1977 | List<Coord> coords = primMesh.coords; | ||
1978 | for (int i = 0; i < numCoords; i++) | ||
1979 | { | ||
1980 | Coord c = coords[i]; | ||
1981 | mesh.vertices.Add(new Vertex(c.X, c.Y, c.Z)); | ||
1982 | } | ||
1983 | |||
1984 | List<Face> faces = primMesh.faces; | ||
1985 | List<Vertex> vertices = mesh.vertices; | ||
1986 | |||
1975 | for (int i = 0; i < numFaces; i++) | 1987 | for (int i = 0; i < numFaces; i++) |
1976 | { | 1988 | { |
1977 | Face f = primMesh.faces[i]; | 1989 | Face f = faces[i]; |
1978 | Coord vert = primMesh.coords[f.v1]; | 1990 | mesh.triangles.Add(new Triangle(vertices[f.v1], vertices[f.v2], vertices[f.v3])); |
1979 | Vertex v1 = new Vertex(vert.X, vert.Y, vert.Z); | ||
1980 | mesh.vertices.Add(v1); | ||
1981 | vert = primMesh.coords[f.v2]; | ||
1982 | Vertex v2 = new Vertex(vert.X, vert.Y, vert.Z); | ||
1983 | mesh.vertices.Add(v2); | ||
1984 | vert = primMesh.coords[f.v3]; | ||
1985 | Vertex v3 = new Vertex(vert.X, vert.Y, vert.Z); | ||
1986 | mesh.vertices.Add(v3); | ||
1987 | mesh.triangles.Add(new Triangle(v1, v2, v3)); | ||
1988 | } | 1991 | } |
1992 | |||
1993 | //for (int i = 0; i < numFaces; i++) | ||
1994 | //{ | ||
1995 | // Face f = primMesh.faces[i]; | ||
1996 | // Coord vert = primMesh.coords[f.v1]; | ||
1997 | // Vertex v1 = new Vertex(vert.X, vert.Y, vert.Z); | ||
1998 | // mesh.vertices.Add(v1); | ||
1999 | // vert = primMesh.coords[f.v2]; | ||
2000 | // Vertex v2 = new Vertex(vert.X, vert.Y, vert.Z); | ||
2001 | // mesh.vertices.Add(v2); | ||
2002 | // vert = primMesh.coords[f.v3]; | ||
2003 | // Vertex v3 = new Vertex(vert.X, vert.Y, vert.Z); | ||
2004 | // mesh.vertices.Add(v3); | ||
2005 | // mesh.triangles.Add(new Triangle(v1, v2, v3)); | ||
2006 | //} | ||
1989 | 2007 | ||
1990 | //mesh.DumpRaw(baseDir, primName, "Mesh"); | 2008 | //mesh.DumpRaw(baseDir, primName, "Mesh"); |
1991 | 2009 | ||