So youre trying to say if its longitudinal axis (that is head-to engine) is laying on the imaginary line between it and the target and correct the angle to fit it if not ?
Not quite, it is a bit more complex. I am measuring the instantaneous angular velocity of the target each frame update call, and calculating its angular acceleration/deceleration, relative to the missile's Y axis. If the missile pointed at where the target is NOW, it would never hit the target. The boost phase of an AGM-65 Maverick is around 0.5 seconds, and the sustain boost phase is around 3.5 seconds, so the missile reaches its maximum velocity within four seconds and then decelerates during what is called the terminal flight phase on its way to the target. It must calculate the targets angular trajectory, relative to the missile seeker, and steer the missile on a collision course with the target's FUTURE position.
For NON-moving targets, what you said would be true, and the script is far less complex.
For simulating infrared target signatures there are a number of ways to accomplish it in terms of developing a simple algorithm. I need to do more research about IR countermeasures, but I believe the missile seeker logic will be to track the thermal signature with the greatest magnitude. In sim, the a thermal signature is just a point, with a variable assigned to the point by looking up the value in an X, Y angle table. The script would calculate the X angle, and Y angle for each IR signature, and request the IR signature values of all the points within its current Field Of View, and calculate for scattering and attenuation of the signal given distance, altitude, etc... The Seeker script would then track the IR point with the highest magnitude signature.
Signal to Noise Ratio (SNR) is especially important, (aka. thermal or infrared contrast, or target/background contrast ratio) but I cannot think of a way to implement such a functionality in a script.
The LASER Maverick tracks an active IR source, and there is a lot more to take into account, such as emmissivity/reflectance of the target, and attenuation of the laser source round-trip.
Everything will be defined under 'Sensor', so the same 'Seeker' script could use many different sensor scripts, both forward and rear facing.
Pyton, I believe those are called Beam Riding seekers, where an electromagnetic (RF/IR) beam is projected at the target and the munition attempts to stay at the center of the beam. Yes that could be done too, but there would be differences to the Guidance/Control System.