Mario Kart Collision Post 2

Creating a box collider 2

  • The fix in the last post would end up being too expensive in the long run to compute and run time so the aforementioned external tool also stored the corners of the mesh instead which could be used to find the centre.

  • A debug collider (an sdkmesh) was made to view the collider in the game (similar to unity) however, this collider showed that the collider wasn’t rotating with the mesh. Because it was taking the yaw, pitch, and roll of the GameObject, not the rotation matrix which was being used to rotate the mesh.

  • To fix this the collider was changed to also rotate with this matrix but the collider uses a quaternion to rotate the mesh and converting the matrix a quaternion seemed to flip the yaw and pitch axis around.

  • To fix this flip the rotation matrix had to be decomposed into yaw, pitch, and roll which was then used to create the collider’s quaternion rotation with yaw and pitch swapped.


Previous
Previous

Mario Kart Collision Post 3

Next
Next

Mario Kart Collision Post 1