aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/UbitMeshing/Mesh.cs
diff options
context:
space:
mode:
authorUbitUmarov2013-05-29 02:08:14 +0100
committerUbitUmarov2013-05-29 02:08:14 +0100
commit4e72cf9ee21dd8833af860fa5af4fc91e11018cb (patch)
treedc3992d2d9383172524eeacf939d9a3bca165ad2 /OpenSim/Region/Physics/UbitMeshing/Mesh.cs
parentAllow Linden trees to preserve their type when taken into inventory and rezze... (diff)
downloadopensim-SC-4e72cf9ee21dd8833af860fa5af4fc91e11018cb.zip
opensim-SC-4e72cf9ee21dd8833af860fa5af4fc91e11018cb.tar.gz
opensim-SC-4e72cf9ee21dd8833af860fa5af4fc91e11018cb.tar.bz2
opensim-SC-4e72cf9ee21dd8833af860fa5af4fc91e11018cb.tar.xz
*** DANGER TESTING **** changed prims mesh generation hopefully removing
spurius faces. CHanged several aspects. Fixed prims inertia that was too low, still using box as model. Increased number of quickstep SOR iterations to 15. Keep it 15 even on heavy load ( will only jump simulation time).
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/UbitMeshing/Mesh.cs33
1 files changed, 10 insertions, 23 deletions
diff --git a/OpenSim/Region/Physics/UbitMeshing/Mesh.cs b/OpenSim/Region/Physics/UbitMeshing/Mesh.cs
index fa06926..0418893 100644
--- a/OpenSim/Region/Physics/UbitMeshing/Mesh.cs
+++ b/OpenSim/Region/Physics/UbitMeshing/Mesh.cs
@@ -205,34 +205,21 @@ namespace OpenSim.Region.Physics.Meshing
205 205
206 } 206 }
207 207
208 private float fRound(float f)
209 {
210 int i;
211 if (f == 0f)
212 return f;
213 else if (f > 0f)
214 i = (int)(1e5f * f + 0.5f);
215 else
216 i = (int)(1e5f * f - 0.5f);
217
218 return ((float)i * 1e-5f);
219 }
220
221 public void Add(Triangle triangle) 208 public void Add(Triangle triangle)
222 { 209 {
223 if (m_indicesPtr != IntPtr.Zero || m_verticesPtr != IntPtr.Zero) 210 if (m_indicesPtr != IntPtr.Zero || m_verticesPtr != IntPtr.Zero)
224 throw new NotSupportedException("Attempt to Add to a pinned Mesh"); 211 throw new NotSupportedException("Attempt to Add to a pinned Mesh");
225 212
226 // round down 213
227 triangle.v1.X = fRound(triangle.v1.X); 214 triangle.v1.X = (float)Math.Round(triangle.v1.X, 6);
228 triangle.v1.Y = fRound(triangle.v1.Y); 215 triangle.v1.Y = (float)Math.Round(triangle.v1.Y, 6);
229 triangle.v1.Z = fRound(triangle.v1.Z); 216 triangle.v1.Z = (float)Math.Round(triangle.v1.Z, 6);
230 triangle.v2.X = fRound(triangle.v2.X); 217 triangle.v2.X = (float)Math.Round(triangle.v2.X, 6);
231 triangle.v2.Y = fRound(triangle.v2.Y); 218 triangle.v2.Y = (float)Math.Round(triangle.v2.Y, 6);
232 triangle.v2.Z = fRound(triangle.v2.Z); 219 triangle.v2.Z = (float)Math.Round(triangle.v2.Z, 6);
233 triangle.v3.X = fRound(triangle.v3.X); 220 triangle.v3.X = (float)Math.Round(triangle.v3.X, 6);
234 triangle.v3.Y = fRound(triangle.v3.Y); 221 triangle.v3.Y = (float)Math.Round(triangle.v3.Y, 6);
235 triangle.v3.Z = fRound(triangle.v3.Z); 222 triangle.v3.Z = (float)Math.Round(triangle.v3.Z, 6);
236 223
237 if ((triangle.v1.X == triangle.v2.X && triangle.v1.Y == triangle.v2.Y && triangle.v1.Z == triangle.v2.Z) 224 if ((triangle.v1.X == triangle.v2.X && triangle.v1.Y == triangle.v2.Y && triangle.v1.Z == triangle.v2.Z)
238 || (triangle.v1.X == triangle.v3.X && triangle.v1.Y == triangle.v3.Y && triangle.v1.Z == triangle.v3.Z) 225 || (triangle.v1.X == triangle.v3.X && triangle.v1.Y == triangle.v3.Y && triangle.v1.Z == triangle.v3.Z)