aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Meshing
diff options
context:
space:
mode:
authorMelanie2012-10-18 20:56:34 +0100
committerMelanie2012-10-18 20:56:34 +0100
commit72c925a6c9eb4dea6f9134db10c3af28ea83df48 (patch)
tree9f991ade4e71f91fc612759b4e783c9f01a740f3 /OpenSim/Region/Physics/Meshing
parentMerge branch 'master' into careminster (diff)
parentRemove redundant and annoyingly modal message box in upload processing. (diff)
downloadopensim-SC-72c925a6c9eb4dea6f9134db10c3af28ea83df48.zip
opensim-SC-72c925a6c9eb4dea6f9134db10c3af28ea83df48.tar.gz
opensim-SC-72c925a6c9eb4dea6f9134db10c3af28ea83df48.tar.bz2
opensim-SC-72c925a6c9eb4dea6f9134db10c3af28ea83df48.tar.xz
Merge branch 'avination' into careminster
Conflicts: OpenSim/Framework/WebUtil.cs OpenSim/Region/Physics/OdePlugin/OdeScene.cs
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/Meshing/Mesh.cs7
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs31
2 files changed, 18 insertions, 20 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs
index c715642..6970553 100644
--- a/OpenSim/Region/Physics/Meshing/Mesh.cs
+++ b/OpenSim/Region/Physics/Meshing/Mesh.cs
@@ -148,6 +148,12 @@ namespace OpenSim.Region.Physics.Meshing
148 return Vector3.Zero; 148 return Vector3.Zero;
149 } 149 }
150 150
151 // not functional
152 public Vector3 GetOBB()
153 {
154 return new Vector3(0.5f, 0.5f, 0.5f);
155 }
156
151 public void CalcNormals() 157 public void CalcNormals()
152 { 158 {
153 int iTriangles = m_triangles.Count; 159 int iTriangles = m_triangles.Count;
@@ -253,6 +259,7 @@ namespace OpenSim.Region.Physics.Meshing
253 public void getVertexListAsPtrToFloatArray(out IntPtr vertices, out int vertexStride, out int vertexCount) 259 public void getVertexListAsPtrToFloatArray(out IntPtr vertices, out int vertexStride, out int vertexCount)
254 { 260 {
255 // A vertex is 3 floats 261 // A vertex is 3 floats
262
256 vertexStride = 3 * sizeof(float); 263 vertexStride = 3 * sizeof(float);
257 264
258 // If there isn't an unmanaged array allocated yet, do it now 265 // If there isn't an unmanaged array allocated yet, do it now
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 3c4f737..f629c4d 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -74,8 +74,6 @@ namespace OpenSim.Region.Physics.Meshing
74#endif 74#endif
75 75
76 private bool cacheSculptMaps = true; 76 private bool cacheSculptMaps = true;
77 private bool cacheSculptAlphaMaps = true;
78
79 private string decodedSculptMapPath = null; 77 private string decodedSculptMapPath = null;
80 private bool useMeshiesPhysicsMesh = false; 78 private bool useMeshiesPhysicsMesh = false;
81 79
@@ -89,16 +87,7 @@ namespace OpenSim.Region.Physics.Meshing
89 IConfig mesh_config = config.Configs["Mesh"]; 87 IConfig mesh_config = config.Configs["Mesh"];
90 88
91 decodedSculptMapPath = start_config.GetString("DecodedSculptMapPath","j2kDecodeCache"); 89 decodedSculptMapPath = start_config.GetString("DecodedSculptMapPath","j2kDecodeCache");
92
93 cacheSculptMaps = start_config.GetBoolean("CacheSculptMaps", cacheSculptMaps); 90 cacheSculptMaps = start_config.GetBoolean("CacheSculptMaps", cacheSculptMaps);
94
95 if (Environment.OSVersion.Platform == PlatformID.Unix)
96 {
97 cacheSculptAlphaMaps = false;
98 }
99 else
100 cacheSculptAlphaMaps = cacheSculptMaps;
101
102 if(mesh_config != null) 91 if(mesh_config != null)
103 useMeshiesPhysicsMesh = mesh_config.GetBoolean("UseMeshiesPhysicsMesh", useMeshiesPhysicsMesh); 92 useMeshiesPhysicsMesh = mesh_config.GetBoolean("UseMeshiesPhysicsMesh", useMeshiesPhysicsMesh);
104 93
@@ -279,18 +268,15 @@ namespace OpenSim.Region.Physics.Meshing
279 { 268 {
280 if (!GenerateCoordsAndFacesFromPrimSculptData(primName, primShape, size, lod, out coords, out faces)) 269 if (!GenerateCoordsAndFacesFromPrimSculptData(primName, primShape, size, lod, out coords, out faces))
281 return null; 270 return null;
282 // Remove the reference to any JPEG2000 sculpt data so it can be GCed
283 // don't loose it
284 // primShape.SculptData = Utils.EmptyBytes;
285 } 271 }
286// primShape.SculptDataLoaded = true;
287 } 272 }
288 else 273 else
289 { 274 {
290 if (!GenerateCoordsAndFacesFromPrimShapeData(primName, primShape, size, lod, out coords, out faces)) 275 if (!GenerateCoordsAndFacesFromPrimShapeData(primName, primShape, size, lod, out coords, out faces))
291 return null; 276 return null;
292 } 277 }
293 // keep compatible 278
279 // Remove the reference to any JPEG2000 sculpt data so it can be GCed
294 primShape.SculptData = Utils.EmptyBytes; 280 primShape.SculptData = Utils.EmptyBytes;
295 281
296 int numCoords = coords.Count; 282 int numCoords = coords.Count;
@@ -335,7 +321,7 @@ namespace OpenSim.Region.Physics.Meshing
335 321
336 if (primShape.SculptData.Length <= 0) 322 if (primShape.SculptData.Length <= 0)
337 { 323 {
338 m_log.InfoFormat("[MESH]: asset data for {0} is zero length", primName); 324// m_log.ErrorFormat("[MESH]: asset data for {0} is zero length", primName);
339 return false; 325 return false;
340 } 326 }
341 327
@@ -496,8 +482,7 @@ namespace OpenSim.Region.Physics.Meshing
496 482
497 //idata = CSJ2K.J2kImage.FromBytes(primShape.SculptData); 483 //idata = CSJ2K.J2kImage.FromBytes(primShape.SculptData);
498 484
499 if (cacheSculptMaps && (cacheSculptAlphaMaps || (((ImageFlags)(idata.Flags) & ImageFlags.HasAlpha) ==0))) 485 if (cacheSculptMaps)
500 // don't cache images with alpha channel in linux since mono can't load them correctly)
501 { 486 {
502 try { idata.Save(decodedSculptFileName, ImageFormat.MemoryBmp); } 487 try { idata.Save(decodedSculptFileName, ImageFormat.MemoryBmp); }
503 catch (Exception e) { m_log.Error("[SCULPT]: unable to cache sculpt map " + decodedSculptFileName + " " + e.Message); } 488 catch (Exception e) { m_log.Error("[SCULPT]: unable to cache sculpt map " + decodedSculptFileName + " " + e.Message); }
@@ -717,7 +702,7 @@ namespace OpenSim.Region.Physics.Meshing
717 return CreateMesh(primName, primShape, size, lod, false); 702 return CreateMesh(primName, primShape, size, lod, false);
718 } 703 }
719 704
720 public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical, bool convex) 705 public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical, bool convex, bool forOde)
721 { 706 {
722 return CreateMesh(primName, primShape, size, lod, false); 707 return CreateMesh(primName, primShape, size, lod, false);
723 } 708 }
@@ -763,7 +748,13 @@ namespace OpenSim.Region.Physics.Meshing
763 748
764 return mesh; 749 return mesh;
765 } 750 }
751 public IMesh GetMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical, bool convex)
752 {
753 return null;
754 }
755
766 public void ReleaseMesh(IMesh imesh) { } 756 public void ReleaseMesh(IMesh imesh) { }
767 public void ExpireReleaseMeshs() { } 757 public void ExpireReleaseMeshs() { }
758 public void ExpireFileCache() { }
768 } 759 }
769} 760}