Example #1
0
		public bool IsEqualVertexTC(Vertex a, Vertex b)
		{
			return (a.pos - b.pos).SqLength < 0.001f &&
				a.tc.x == b.tc.x && a.tc.y == b.tc.y;
		}
Example #2
0
		public void GenerateUniqueVectors(Vertex[] verts, out Vector3[] vertPos, out int[] old2new)
		{
			List<Vector3> vp = new List<Vector3>();
			old2new = new int[verts.Length];

			for (int a = 0; a < verts.Length; a++) {
				bool matched = false;

				for (int b = 0; b < vp.Count; b++)
					if ((vp[b] - verts[a].pos).SqLength < 0.001f) {
						old2new[a] = b;
						matched = true;
						break;
					}
				if (!matched) {
					old2new[a] = vp.Count;
					vp.Add(verts[a].pos);
				}
			}
			vertPos = vp.ToArray();
		}
Example #3
0
		public Plane CalcPlane(Vertex[] vrt)
		{
			return Plane.FromTriangle(vrt[verts[0]].pos, vrt[verts[1]].pos, vrt[verts[2]].pos);
		}
Example #4
0
		public bool IsEqualVertexTCNormal(Vertex a, Vertex b)
		{
			return (a.pos - b.pos).SqLength < 0.001f &&
				a.tc.x == b.tc.x && a.tc.y == b.tc.y &&
				(a.normal - b.normal).SqLength < 0.001f;
		}