diff options
author | Teravus Ovares | 2008-05-25 02:56:00 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-05-25 02:56:00 +0000 |
commit | c29409dc244c01e8a338d6cab8259245ede18510 (patch) | |
tree | 5ec3c8c9d91a761bfe959cdb0b2246caa9c8bee5 | |
parent | * kill a potentially large float array. (diff) | |
download | opensim-SC-c29409dc244c01e8a338d6cab8259245ede18510.zip opensim-SC-c29409dc244c01e8a338d6cab8259245ede18510.tar.gz opensim-SC-c29409dc244c01e8a338d6cab8259245ede18510.tar.bz2 opensim-SC-c29409dc244c01e8a338d6cab8259245ede18510.tar.xz |
* Yet another way to optimize the sculpt mesh generator
-rw-r--r-- | OpenSim/Region/Physics/Meshing/SculptMesh.cs | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs index 5760591..c9933fe 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs +++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs | |||
@@ -251,7 +251,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
251 | } | 251 | } |
252 | 252 | ||
253 | // Create the Triangles | 253 | // Create the Triangles |
254 | int i = 0; | 254 | //int i = 0; |
255 | 255 | ||
256 | for (int y = 0; y < y_max - 1; y++) | 256 | for (int y = 0; y < y_max - 1; y++) |
257 | { | 257 | { |
@@ -293,42 +293,42 @@ namespace OpenSim.Region.Physics.Meshing | |||
293 | } | 293 | } |
294 | 294 | ||
295 | } | 295 | } |
296 | Vertex vt31 = sVertices[(y * x_max + x)]; | 296 | //Vertex vt31 = sVertices[(y * x_max + x)]; |
297 | Vertex vt32 = sVertices[(y * x_max + 0)]; | 297 | //Vertex vt32 = sVertices[(y * x_max + 0)]; |
298 | Vertex vt33 = sVertices[((y + 1) * x_max + 0)]; | 298 | //Vertex vt33 = sVertices[((y + 1) * x_max + 0)]; |
299 | if (vt31 != null && vt32 != null && vt33 != null) | 299 | //if (vt31 != null && vt32 != null && vt33 != null) |
300 | { | 300 | //{ |
301 | if (vt31.Equals(vt32, 0.022f) || vt31.Equals(vt33, 0.022f) || vt32.Equals(vt33, 0.022f)) | 301 | //if (vt31.Equals(vt32, 0.022f) || vt31.Equals(vt33, 0.022f) || vt32.Equals(vt33, 0.022f)) |
302 | { | 302 | //{ |
303 | } | 303 | //} |
304 | else | 304 | //else |
305 | { | 305 | //{ |
306 | //Triangle tri3 = new Triangle(vt31, vt32, vt33); | 306 | //Triangle tri3 = new Triangle(vt31, vt32, vt33); |
307 | // Wrap the last cell in the row around | 307 | // Wrap the last cell in the row around |
308 | //indices[i++] = (ushort)(y * x_max + x); //a | 308 | //indices[i++] = (ushort)(y * x_max + x); //a |
309 | //indices[i++] = (ushort)(y * x_max + 0); //b | 309 | //indices[i++] = (ushort)(y * x_max + 0); //b |
310 | //indices[i++] = (ushort)((y + 1) * x_max + 0); //c | 310 | //indices[i++] = (ushort)((y + 1) * x_max + 0); //c |
311 | //Add(tri3); | 311 | //Add(tri3); |
312 | } | 312 | // } |
313 | } | 313 | //} |
314 | 314 | ||
315 | Vertex vt41 = sVertices[(y * x_max + x)]; | 315 | //Vertex vt41 = sVertices[(y * x_max + x)]; |
316 | Vertex vt42 = sVertices[((y + 1) * x_max + 0)]; | 316 | //Vertex vt42 = sVertices[((y + 1) * x_max + 0)]; |
317 | Vertex vt43 = sVertices[((y + 1) * x_max + x)]; | 317 | //Vertex vt43 = sVertices[((y + 1) * x_max + x)]; |
318 | if (vt41 != null && vt42 != null && vt43 != null) | 318 | //if (vt41 != null && vt42 != null && vt43 != null) |
319 | { | 319 | //{ |
320 | if (vt41.Equals(vt42, 0.022f) || vt31.Equals(vt43, 0.022f) || vt32.Equals(vt43, 0.022f)) | 320 | //if (vt41.Equals(vt42, 0.022f) || vt31.Equals(vt43, 0.022f) || vt32.Equals(vt43, 0.022f)) |
321 | { | 321 | //{ |
322 | } | 322 | //} |
323 | else | 323 | // else |
324 | { | 324 | // { |
325 | //Triangle tri4 = new Triangle(vt41, vt42, vt43); | 325 | //Triangle tri4 = new Triangle(vt41, vt42, vt43); |
326 | //indices[i++] = (ushort)(y * x_max + x); //a | 326 | //indices[i++] = (ushort)(y * x_max + x); //a |
327 | //indices[i++] = (ushort)((y + 1) * x_max + 0); //b | 327 | //indices[i++] = (ushort)((y + 1) * x_max + 0); //b |
328 | //indices[i++] = (ushort)((y + 1) * x_max + x); //c | 328 | //indices[i++] = (ushort)((y + 1) * x_max + x); //c |
329 | //Add(tri4); | 329 | //Add(tri4); |
330 | } | 330 | //} |
331 | } | 331 | //} |
332 | 332 | ||
333 | } | 333 | } |
334 | } | 334 | } |