Collision "Repel" for rotated objects

Hi everyone,

Does anyone have any idea about collision detection for kinematic (basically regular) objects that have been rotated? For axis aligned (non rotated) its very easy to do a sweep test. It works for rotated objects, but, not as well… In addition the player is still able to rotate when that occurs.

Here’s a small clip detailing the issue:

https://streamable.com/006hba

Vehicle Controller:

GameState:

Main.java simply attaches GameState to stateManager

I was think about shooting a ray from all four corners and seeing if distance was low… but I’m not sure in which direction the rays should go then. If I just did UnitZ etc, it wouldn’t change direction (“become diagonal”) as the vehicle rotated.

Thanks in advance!

The sweep tests for rotLeft and rotRight are commented out.

Hi,

Yes, I did so because they didn’t work even when they were enabled. I tried commenting them out before but it made no difference. I’ve somewhat combated this by having the vehicle rebound as it hits terrain. However, I’ve encountered a very nasty bug now… at around 0.22 to -0.22 radians of rotation, the vehicle acts extremely strange. It can’t go fast(very slow) and non of my rebounding works at all. I have no idea why and have been trying to figure this out for the last few hours… If anyone would be able to take a look and help me combat this issue it would be much appreciated.

VehicleController.java

A video of the issue:

https://streamable.com/l22u10

As you can see, the framerate drogs signficantly at that angle and the its as if something is pushing it back.