How to Calculate Hovercraft Forces?
I finally have a little hovercraft roaming my heightmap terrain.. the problem is, its motion is extremely unrealistic. If it hits the ground, it simply bounces off, but its "hovering" ability is represented by force beams. Basically you can put an arbitrary number of beams of different strengths at the bottom of the craft. Those beams then cast rays and find the distance to the terrain. The force due to each beam is proportional to the inverse of the distance to the terrain. Problem is... if I make the too forces strong, the craft flies several meters off the terrain, but if I make them too weak, it keeps bottoming out and whacking the terrain!
I''ve also tried different polynomail variants (i.e. Fbeam=1/(dist^2+dist) ) as well as having a "cutoff" distance (if the distance from a beam to the terrain is greater than 3 meters, it provides NO force) but no matter what I do it provides extremely unrealistic results.
I would have thought tweaking parameters was the easy part! Any suggestions as to how I should compute the forces on the hovercraft?
Thanks in advance,
bill
Most real hovercraft hit the terrain if you drive too fast over bumpy terrain. Make your hovercraft fly higher, or make the terrain less bumpy.
Other possible solutions include realistically handling collision with the terrain; check if you''re closer than (tolerance) and slow down, play a sound, and subtract hitpoints. Maybe move the direction the craft is going, too.
Another solution would be to add a non-linear "booster" force by multiplying the force you get if and only if the beam is lower than cruising altitude. I e:
This is non-physical, but may work well for games.
Other possible solutions include realistically handling collision with the terrain; check if you''re closer than (tolerance) and slow down, play a sound, and subtract hitpoints. Maybe move the direction the craft is going, too.
Another solution would be to add a non-linear "booster" force by multiplying the force you get if and only if the beam is lower than cruising altitude. I e:
float getForceFromHeight( float height ){ if( height < AbsoluteMinimum ) height = AbsoluteMinimim; force = ForceMultiplier / height; if( height < CruisingHeight ) force = force * CruisingHeight / height; return force;}
This is non-physical, but may work well for games.
Thanks for the response.
As far as the realistic detection, I''m not 100 percent sure what you mean.. right now I have fairly inelastic impulse-based collisions with the terrain, which will slow it down if it bumps the terrain. So it will behave realistically if it hits the terrain, but at most I want it to bump and jostle when it goes over some rough terrain. Right now it just seems like the hovercraft doesn''t HOVER.. it either oscillates wildly going way too high, or it just drags on the ground.
And I agree some sort of corrective force would be the easy way out.. but I''m not turning back now. :-) The way I''m doing it now is much more general and less constrained... beams can shoot out diagonally downwards from the corners of the hovercraft for example to give it some stability.
As far as the realistic detection, I''m not 100 percent sure what you mean.. right now I have fairly inelastic impulse-based collisions with the terrain, which will slow it down if it bumps the terrain. So it will behave realistically if it hits the terrain, but at most I want it to bump and jostle when it goes over some rough terrain. Right now it just seems like the hovercraft doesn''t HOVER.. it either oscillates wildly going way too high, or it just drags on the ground.
And I agree some sort of corrective force would be the easy way out.. but I''m not turning back now. :-) The way I''m doing it now is much more general and less constrained... beams can shoot out diagonally downwards from the corners of the hovercraft for example to give it some stability.
I would suggest that the corrective force might be the only possible solution... as a real hovercraft exerts a force over a larger area. A proper solution would be to calculate the pressure field under the rubber skirt, and integrate the force applied to the skirt, and the under side of the hovercraft. This method would probably be a bit over the top... but other than that... I can''t see another sensible option.
Interesting problem... i had a little think about it and i think this might just work... try this for the force:
force = k / (dist - height)
where k is a constant that you''ll need to play around with (larger values should give you more bounce while small values will provide almost no bounce).
and height is another constant representing the very minimum height that the aircraft in theory should ever reach (think of it like the height of the skirt), you probably want to set this to something like 20/30 cm (I don''t know what that would translate to in your game units).
theoretically this should work fine, and (dist - height) should never reach 0 or go negative... but in practise that might happen so i think you''ll need a statement something like this:
if (dist - height <= 0)
force = maxforce;
else
force = k / (dist - height);
if (force > maxforce)
force = maxforce;
maxforce should be some constant that is the maximum force you want this beam to exert... Its not really a quick hack, because in theory the hovercraft won''t be able to produce unlimited force...
Hope this helps, and provides realistic results... tell me what happens :D
force = k / (dist - height)
where k is a constant that you''ll need to play around with (larger values should give you more bounce while small values will provide almost no bounce).
and height is another constant representing the very minimum height that the aircraft in theory should ever reach (think of it like the height of the skirt), you probably want to set this to something like 20/30 cm (I don''t know what that would translate to in your game units).
theoretically this should work fine, and (dist - height) should never reach 0 or go negative... but in practise that might happen so i think you''ll need a statement something like this:
if (dist - height <= 0)
force = maxforce;
else
force = k / (dist - height);
if (force > maxforce)
force = maxforce;
maxforce should be some constant that is the maximum force you want this beam to exert... Its not really a quick hack, because in theory the hovercraft won''t be able to produce unlimited force...
Hope this helps, and provides realistic results... tell me what happens :D
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement