ground hugging missile

Blitz3D Forums/Blitz3D Programming/ground hugging missile

ryan scott(Posted 2004) [#1]
before i go crazy trying to figure it out does someone have an example of how to cause a missile to hug the terrain as it moves? the missle needs to point up hill as it moves up hill, down as it moves down, obviously. so, it's more than just a ball. do i need a pivot on the missle? i just have a speed and its facing the 'right' direction, until it runs into a hill.


Perturbatio(Posted 2004) [#2]
at a guess:
parent it to a pivot that is a little bit below the missle, then when you rotate the pivot, the missile should turn appropriately, then you can use AlignToVector.
Maybe vary the distance that the missileis from the pivot to give it a more natural look.


Matty(Posted 2004) [#3]
This should help:

http://www.blitzbasic.com/codearcs/codearcs.php?code=67


Doktor Zeus(Posted 2004) [#4]
I'd have it gravitate towards a point a certain height above the terrain at a set rate, so that there was a limit to the height of hill it could climb without crashing. A skipping effect might also be amusing.

Ash


Bot Builder(Posted 2004) [#5]
You could try something like this:
Const elevation#
Function UpdateGroundHugger(entity)
 PositionEntity entity, EntityX(entity), TerrainY(Terr,EntityX(entity), EntityY(entity), EntityZ(entity))+elevation#, EntityZ(entity)
 TFormPoint 0,0,1,entity,0
 AlignToVector entity,TformedX(),TerrainY(err,TformedX(),TformedY(),TformedZ())+elevation#,TformedZ(),3
End Function


BTW, punched into browser so who knows if it works


Jeroen(Posted 2004) [#6]
I *accidentely* made a ground hugging missile.
Just make a collision between the terrain and the missile, and move the entity down. It will hug the terrain.
But, Bot Builders solution is better (no collision required)