aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin/Meshing/Extruder.cs
diff options
context:
space:
mode:
authorJeff Ames2007-11-10 21:20:55 +0000
committerJeff Ames2007-11-10 21:20:55 +0000
commit9a4b4dae5e6097b9e70936cfaca483ec7f9120ec (patch)
treeaa83f67a15d68e02e9dfa8b25a45aedf56968653 /OpenSim/Region/Physics/OdePlugin/Meshing/Extruder.cs
parent* Moves the Meshmerizer to a separate plugin (diff)
downloadopensim-SC-9a4b4dae5e6097b9e70936cfaca483ec7f9120ec.zip
opensim-SC-9a4b4dae5e6097b9e70936cfaca483ec7f9120ec.tar.gz
opensim-SC-9a4b4dae5e6097b9e70936cfaca483ec7f9120ec.tar.bz2
opensim-SC-9a4b4dae5e6097b9e70936cfaca483ec7f9120ec.tar.xz
removed OdePlugin/Meshing directory
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/Meshing/Extruder.cs')
-rwxr-xr-xOpenSim/Region/Physics/OdePlugin/Meshing/Extruder.cs83
1 files changed, 0 insertions, 83 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/Meshing/Extruder.cs b/OpenSim/Region/Physics/OdePlugin/Meshing/Extruder.cs
deleted file mode 100755
index 497e039..0000000
--- a/OpenSim/Region/Physics/OdePlugin/Meshing/Extruder.cs
+++ /dev/null
@@ -1,83 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Region.Physics.OdePlugin.Meshing
6{
7 class Extruder
8 {
9 public float startParameter;
10 public float stopParameter;
11 public Manager.PhysicsVector size;
12
13 public Mesh Extrude(Mesh m)
14 {
15 // Currently only works for iSteps=1;
16 Mesh result = new Mesh();
17
18 Mesh workingPlus = m.Clone();
19 Mesh workingMinus = m.Clone();
20
21 foreach (Vertex v in workingPlus.vertices)
22 {
23 if (v == null)
24 continue;
25
26 v.Z = +.5f;
27 v.X *= size.X;
28 v.Y *= size.Y;
29 v.Z *= size.Z;
30 }
31
32 foreach (Vertex v in workingMinus.vertices)
33 {
34 if (v == null)
35 continue;
36
37 v.Z = -.5f;
38 v.X *= size.X;
39 v.Y *= size.Y;
40 v.Z *= size.Z;
41 }
42
43 foreach (Triangle t in workingMinus.triangles)
44 {
45 t.invertNormal();
46 }
47
48 result.Append(workingMinus);
49 result.Append(workingPlus);
50
51 int iLastNull = 0;
52 for (int i = 0; i < workingPlus.vertices.Count; i++)
53 {
54 int iNext = (i + 1);
55
56 if (workingPlus.vertices[i] == null) // Can't make a simplex here
57 {
58 iLastNull = i+1;
59 continue;
60 }
61
62 if (i == workingPlus.vertices.Count-1) // End of list
63 {
64 iNext = iLastNull;
65 }
66
67 if (workingPlus.vertices[iNext] == null) // Null means wrap to begin of last segment
68 {
69 iNext = iLastNull;
70 }
71
72 Triangle tSide;
73 tSide = new Triangle(workingPlus.vertices[i], workingMinus.vertices[i], workingPlus.vertices[iNext]);
74 result.Add(tSide);
75
76 tSide = new Triangle(workingPlus.vertices[iNext], workingMinus.vertices[i], workingMinus.vertices[iNext]);
77 result.Add(tSide);
78 }
79
80 return result;
81 }
82 }
83}