Mario Kart Collision Post 2

Mario Kart Collision Post 2

Mar 5, 2019. | By: Evan Diamond
1 min

The second post in making collision for mario kart in DirectX12

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.

About

Gamers developing new games.

Social Links

Our Bunker

University of the West of England,
Frenchay Campus, Bristol, BS16 1QY,
United Kingdom.