Hovercraft vehicle collision response

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Hovercraft vehicle collision response

Postby mikeman42 » Wed Jan 18, 2012 1:07 pm

I'm making an F-Zero-like game with hovercrafts.

My problem here is collision response. I simulate the vehicle as rigid boxes and implement raycast car with 4 raycasts where the supposed "thrusters" would be. So far, so good. The problem is that collision with track walls is very weird. The vehicle spins out of control many times. It's really unpredictable. I can't upload a video right now, but generally when the vehicle collides with the wall at an angle, it spins 2-3 times before stopping. I have tried adding drag, friction, but to no avail. What could be the problem here? How to get more sane collision response? Thank you!
mikeman42
 
Posts: 19
Joined: Tue May 01, 2007 6:08 pm

Re: Hovercraft vehicle collision response

Postby Julio Jerez » Wed Jan 18, 2012 2:10 pm

basically the only way you can have preside controll is by attaching a control joint.
you can adda custom joint that in the callback it wil check if the body collided. if the body did not collide then it will return.
if it collide it will read the angular velocity and calcul teh the magnitud. and it will normalize it
the normalized angular direction vector is the axxi the is use to apply teh Inertiat dampers. (basically a brake)
excencialy it will add and angle row that will substract a fractio o fte hangular velocity.

there is and example of that joint in the engine: CustomDryRollingFriction
bascially you cna contlo presicetly the amount of turns by manipulation the m_torqueFriction parameter.

in fact you can also use to steer the craft
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Hovercraft vehicle collision response

Postby Sweenie » Wed Jan 18, 2012 4:15 pm

Not sure if it's the same issue i had but if you cast the rays from corners of your vehicle it might be the case that the raycast intersect the wall. Now if you use the hitnormal to calculate the "hover" force this wall intersection may generate a high sideway force on your vehicle. Try debugging and check if that is the case.
If it's true you could try filtering out ray intersections with vertical(or near vertical) surfaces or just ignore raycasts against the walls by using face id's.
Sweenie
 
Posts: 503
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 214 guests

cron