private void addConnectingVerts(int triangleIndex, int vertexIndex, ref int[] output)
{
// Index to triangle array
int globalIndex = triangleIndex + vertexIndex;
// Create vertice index relative to triangle index
int connectingVerticeIndexOne, connectingVerticeIndexTwo;
// Get connectinv vertices based on vertex index
switch (vertexIndex)
{
case 0:
connectingVerticeIndexOne = globalIndex + 1;
connectingVerticeIndexTwo = globalIndex + 2;
break;
case 1:
connectingVerticeIndexOne = globalIndex + 1;
connectingVerticeIndexTwo = globalIndex - 1;
break;
default:
connectingVerticeIndexOne = globalIndex - 1;
connectingVerticeIndexTwo = globalIndex - 2;
break;
}
// Increase size of array till proper size
output[0] = this.triangles[globalIndex];
output[1] = this.mesh.triangles[connectingVerticeIndexOne];
output[2] = this.mesh.triangles[connectingVerticeIndexTwo];
}