aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorDahlia Trimble2009-04-02 06:54:48 +0000
committerDahlia Trimble2009-04-02 06:54:48 +0000
commitb42fec5c74e51ca909ce884a564ee3e9163ae16a (patch)
tree6154b8d69219cab0641fee363d9ced0382c162db /OpenSim/Region
parentCorrection to "user" example config option for IRC (diff)
downloadopensim-SC_OLD-b42fec5c74e51ca909ce884a564ee3e9163ae16a.zip
opensim-SC_OLD-b42fec5c74e51ca909ce884a564ee3e9163ae16a.tar.gz
opensim-SC_OLD-b42fec5c74e51ca909ce884a564ee3e9163ae16a.tar.bz2
opensim-SC_OLD-b42fec5c74e51ca909ce884a564ee3e9163ae16a.tar.xz
partial support for sculpted prim "inside out" setting
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Physics/Meshing/SculptMesh.cs49
1 files changed, 38 insertions, 11 deletions
diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs
index b458ed4..5b0a881 100644
--- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs
+++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs
@@ -231,6 +231,10 @@ namespace PrimMesher
231 normals = new List<Coord>(); 231 normals = new List<Coord>();
232 uvs = new List<UVCoord>(); 232 uvs = new List<UVCoord>();
233 233
234 if (mirror)
235 if (sculptType != SculptType.plane)
236 invert = !invert;
237
234 //float sourceScaleFactor = (float)lod / (float)Math.Max(sculptBitmap.Width, sculptBitmap.Height); 238 //float sourceScaleFactor = (float)lod / (float)Math.Max(sculptBitmap.Width, sculptBitmap.Height);
235 float sourceScaleFactor = (float)(lod) / (float)Math.Sqrt(sculptBitmap.Width * sculptBitmap.Height); 239 float sourceScaleFactor = (float)(lod) / (float)Math.Sqrt(sculptBitmap.Width * sculptBitmap.Height);
236 bool scaleSourceImage = sourceScaleFactor < 1.0f ? true : false; 240 bool scaleSourceImage = sourceScaleFactor < 1.0f ? true : false;
@@ -338,20 +342,43 @@ namespace PrimMesher
338 342
339 if (viewerMode) 343 if (viewerMode)
340 { 344 {
341 f1 = new Face(p1, p3, p4, p1, p3, p4); 345 if (invert)
342 f1.uv1 = p1; 346 {
343 f1.uv2 = p3; 347 f1 = new Face(p1, p4, p3, p1, p4, p3);
344 f1.uv3 = p4; 348 f1.uv1 = p1;
345 349 f1.uv2 = p4;
346 f2 = new Face(p1, p4, p2, p1, p4, p2); 350 f1.uv3 = p3;
347 f2.uv1 = p1; 351
348 f2.uv2 = p4; 352 f2 = new Face(p1, p2, p4, p1, p2, p4);
349 f2.uv3 = p2; 353 f2.uv1 = p1;
354 f2.uv2 = p2;
355 f2.uv3 = p4;
356 }
357 else
358 {
359 f1 = new Face(p1, p3, p4, p1, p3, p4);
360 f1.uv1 = p1;
361 f1.uv2 = p3;
362 f1.uv3 = p4;
363
364 f2 = new Face(p1, p4, p2, p1, p4, p2);
365 f2.uv1 = p1;
366 f2.uv2 = p4;
367 f2.uv3 = p2;
368 }
350 } 369 }
351 else 370 else
352 { 371 {
353 f1 = new Face(p1, p3, p4); 372 if (invert)
354 f2 = new Face(p1, p4, p2); 373 {
374 f1 = new Face(p1, p4, p3);
375 f2 = new Face(p1, p2, p4);
376 }
377 else
378 {
379 f1 = new Face(p1, p3, p4);
380 f2 = new Face(p1, p4, p2);
381 }
355 } 382 }
356 383
357 this.faces.Add(f1); 384 this.faces.Add(f1);