Esempio n. 1
0
        //
        // 摘要:
        //     Rotates a vector current towards target.
        //
        // 参数:
        //   current:
        //     The vector being managed.
        //
        //   target:
        //     The vector.
        //
        //   maxRadiansDelta:
        //     The distance between the two vectors in radians.
        //
        //   maxMagnitudeDelta:
        //     The length of the radian.
        //
        // 返回结果:
        //     The location that RotateTowards generates.
        public static FVector3 RotateTowards(FVector3 current, FVector3 target, Fix64 maxRadiansDelta, Fix64 maxMagnitudeDelta)
        {
            FQuaternion q = new FQuaternion();

            FQuaternion.AngleAxis(maxRadiansDelta, Cross(current, target));
            return(q * current);
        }
Esempio n. 2
0
        //
        // 摘要:
        //     Spherically interpolates between two vectors.
        //
        // 参数:
        //   a:
        //
        //   b:
        //
        //   t:
        public static FVector3 SlerpUnclamped(FVector3 a, FVector3 b, Fix64 t)
        {
            FQuaternion qa   = new FQuaternion(a);
            FQuaternion qb   = new FQuaternion(a);
            FQuaternion qend = FQuaternion.Lerp(qa, qb, t);

            return(new FVector3(qend.x, qend.y, qend.z));
        }