05/09/2017 – Implememnting Sutherland Hogman Clipping

  • Implement a check to see if it is a single point hitting the face
  • Implemented an IDX value to hold the endpoint of the line segment to be tested against the plane
    • When j < clippedPoints.count – 1, IDX is j+1
    • When j = Clippedpoints.count – 1, IDX is 0
    • This is because we want a complete shape. This means we want to use the following pairs of vertex indexes on a quadrilateral incident face
      • 0,1 – j, j+1
      • 1,2 – j, j+1
      • 2,3 – j, j+1
      • 3,0 – j, 0
  • Implement a line segment plane intersection
  • Clipping algorithm implemented as below for each of the side faces of the reference plane
  • Implement an averaging of the clipped points below he reference plane to give a single point
  • Implement a function to provide the closest point on a plane to a known point
  • TEST:
    • face to face
      • collision points is set as NaN
    • edge to face
      • Collision point it Nan
    • point to face
      • Seems to work but impulse is negative
    • Problem area is likely in the selection of the corners in the collision