Exemplo n.º 1
0
            private Vector3D APN()
            {
                Vector3D nRelativeVelocityVec = RelativeVelocityVec;
                double   mRelativeVelocity    = nRelativeVelocityVec.Normalize();

                Vector3D accelerationNormal;

                accelerationNormal  = PGAIN * RelativeVelocityVec.Cross(CalculateRotVec());     //PPN term
                accelerationNormal += PGAIN * TargetAccel / 2;                                  //APN term
                accelerationNormal += NewLos;                                                   //LosBias term

                return(accelerationNormal);
            }
Exemplo n.º 2
0
            private Vector3D HPN()
            {
                double lambda  = LOSRate;
                double gamma   = (PGAIN * LOSRate);
                float  cos     = MyMath.FastCos((float)gamma - (float)lambda);
                double IPNGain = (RelativeVelocityVec.Length() * PGAIN) / (MissileVelocityVec.Length() * cos);

                IPNGain = MathHelperD.Clamp(IPNGain, MINN, MAXN);
                IPNGain = (!double.IsNaN(IPNGain)) ? IPNGain : PGAIN;

                DebugEcho($"IPNGain: {IPNGain:#.###}");


                Vector3D accelerationNormal;

                accelerationNormal  = IPNGain * RelativeVelocityVec.Cross(CalculateRotVec());       //PPN term
                accelerationNormal += IPNGain * TargetAccel / 2;                                    //APN term
                accelerationNormal += IPNGain * LosDelta;                                           //HPN term
                accelerationNormal += -rc.GetNaturalGravity();                                      //Gravity term
                accelerationNormal += NewLos;                                                       //LosBias term

                return(accelerationNormal);
            }
Exemplo n.º 3
0
            private Vector3D PPN()
            {
                Vector3D accelerationNormal = PGAIN * RelativeVelocityVec.Cross(CalculateRotVec());      //PPN term

                return(accelerationNormal);
            }