Hello again! Sorry for the late post, I have fallen behind in schedule (I will talk about that later) but nevertheless this post will act as my Week 3 check-in. Let's start with the good news! Last week, I submitted my parabola into inverse sphere collision test. After reviewing with my mentors, I realized that the surface point and surface normal were a little inaccurate. With the help of my mentors, I spent a little bit of week 3 fixing the surface point and normal and now my collision test is merged!
For week 3, my primary objective was to implement a box into capsule collision test, and it is still quite the challenge. There were many approaches that I tried but none of them were sufficient. The approach that I decided to stick with was to represent the capsule as 3 parts: 2 hemispheres and a cylinder. My initial attempt was naive; I tried to convert the box into the capsule's coordinate space, and test the box for intersection with the cylinder. However, I realized that it was difficult to test for intersection when the box was in the capsule's coordinate space. Instead, I converted the capsule into the box's coordinate space, and proceeded to find the nearest point on the box to the capsule's center. After, I convert this point to the capsule's coordinate space where it's aligned with the y axis, and do a cylinder test. This method seemed to work, and after finalizing it I sent in a pull request to the main repository.
After some discussion with my mentors, I realized that finding the point on the box closest to the capsule's center was not reliable. This is because the point closest to the center is not necessarily the point that is intersecting with the capsule, especially when the capsule is slanted to an angle! There is also some discussion on which part of the cylinder should be tested first. Currently, the cylinder part of the capsule is checked first and the endcaps second.
This week (week 4), I was supposed to start implementing the Heightfield class. This consists of being able to construct it using a PNMImage and an line intersection test. As you can see, I am still caught up in box into cylinder but I am determined to nail it down. However, if I continue to struggle with it, then I might have to postpone the capsule test perhaps until the "code-break" week and begin the Heightfield test. I still have hope that I can take the remaining weekend to finish box into capsule. I will update you on how it goes!