Jump to content
  • Advertisement
Sign in to follow this  
Sidd

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

This topic is 935 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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? 

 

 

Share this post


Link to post
Share on other sites
Advertisement
If this is specifically two wheels what does the collision volume look like? Because that is an awesome and unusual behavior.

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!