   return emittedVertexCount;
 }
 
-void addCutPositionIfNew(vec4 newPos)
+void addCutPositionIfNew(const vec4 newPos)
 {
   for (int i = 0; i < cutPositionCount; ++i)
   {

  float magnitude = sqrt(dot(plane.xyz, plane.xyz));
  plane = plane / magnitude;

  vec4 c = triangle[0] + triangle[1] + triangle[2];
  c = c * 0.25 + vec4(0.8, 0.8, 0.8, 0);
  c.a = 1;
  for (int i = 0; i < 3; ++i)
  {
    vec4 inPos = triangle[i];

  {
    vec4 temp = cutPositions[i];
    int j = i - 1;
    while (hasSmallerAngle(matrix * center, matrix * temp,
                           matrix * cutPositions[j]) &&
           j >= 0)
    {
      cutPositions[j + 1] = cutPositions[j];
      j = j - 1;
    }
    cutPositions[j + 1] = temp;
