From 73251ed3469e0e0b095c936549c3d557d23af135 Mon Sep 17 00:00:00 2001 From: Dahlia Trimble Date: Tue, 14 Jul 2009 06:09:18 +0000 Subject: [PATCH] add a constructor overload and an AddPos method to SculptMesh --- OpenSim/Region/Physics/Meshing/SculptMesh.cs | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs index 51c8d42d5b..bf42feeda7 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs +++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs @@ -91,6 +91,13 @@ namespace PrimMesher return sculptMesh; } + public SculptMesh(string fileName, int sculptType, int lod, int viewerMode, int mirror, int invert) + { + Bitmap bitmap = (Bitmap)Bitmap.FromFile(fileName); + _SculptMesh(bitmap, (SculptType)sculptType, lod, viewerMode != 0, mirror != 0, invert != 0); + bitmap.Dispose(); + } + /// /// ** Experimental ** May disappear from future versions ** not recommeneded for use in applications /// Construct a sculpt mesh from a 2D array of floats @@ -467,6 +474,32 @@ namespace PrimMesher } } + /// + /// Adds a value to each XYZ vertex coordinate in the mesh + /// + /// + /// + /// + public void AddPos(float x, float y, float z) + { + int i; + int numVerts = this.coords.Count; + Coord vert; + + for (i = 0; i < numVerts; i++) + { + vert = this.coords[i]; + vert.X += x; + vert.Y += y; + vert.Z += z; + this.coords[i] = vert; + } + } + + /// + /// Rotates the mesh + /// + /// public void AddRot(Quat q) { int i;