Example #1
0
        public static Quaternion16 InterpolateQuaternion16(this AnimInterpolator ap, Quaternion16 v1, Quaternion16 v2, float pct)
        {
            short d1 = (short)(v2.x - v1.x);
            short d2 = (short)(v2.y - v1.y);
            short d3 = (short)(v2.z - v1.z);
            short d4 = (short)(v2.w - v1.w);

            Quaternion16 ret = new Quaternion16();

            ret.x = (short)(v1.x + (short)(d1 * pct));
            ret.y = (short)(v1.y + (short)(d2 * pct));
            ret.z = (short)(v1.z + (short)(d3 * pct));
            ret.w = (short)(v1.w + (short)(d4 * pct));

            return(ret);
        }
Example #2
0
        public override object Convert(object value)
        {
            Quaternion16 q16 = (Quaternion16)value;

            return((object)q16.ToQuaternion(UseFixed));
        }