Advertisement

Vehicle Physics - Collision detection - two wheeled vehicle driving up walls

Started by March 02, 2016 05:51 PM
1 comment, last by Sidd 8 years, 11 months ago

My current solution to avoid this kind of behavior is to perform a dot product between the impact normal and the forward direction of the vehicle. If the abs(result) is above a certain value I'll add a impulse force to keep the vehicle away from the wall.

But this solution is only temporary as it breaks when the walls are tilted or when the vehicle attacks the wall from the side.

(I'm using the UE4 and the game is in 3D)

Any ideas for a better solution for this kind of problem?

If this is specifically two wheels what does the collision volume look like? Because that is an awesome and unusual behavior.
Advertisement

Yes, it's a two wheeled with spring physics. When it hits the wall the front wheel gets compressed, tilting the vehicle upwards, enabling it to run up walls. The friction is custom calculated which is why it's possible.

It's currently behaving like RocketLeague vehicles... But I don't want it to.

I'm currently performing a raycast around the vehicle, applying a helping hand force to avoid wall collisions; Calculating dot products, both in the right and front angle directions, but it is not enough to keep it from climbing the walls. I'm gonna try apply a downwards torque force to keep it on the ground but I have little hope it'll work.

There has to be a clever mathematical solution to keep it from climbing the walls...

This topic is closed to new replies.

Advertisement