public void ProcessAnimation(UnityEngine.Animations.AnimationStream stream)
    {
        float w = jobWeight.Get(stream);

        if (w > 0f)
        {
            float3 v = sourceMapping == TransformMapping.Location ? source.GetLocalPosition(stream) : sourceMapping == TransformMapping.Rotation ? source.GetLocalRotation(stream).eulerAngles : source.GetLocalScale(stream);
            if (sourceMapping == TransformMapping.Rotation)
            {
                if (math.abs(v.x - lastRotation.x) > 180)
                {
                    revolutions += math.sign(v.x - lastRotation.x);
                }
                if (math.abs(v.y - lastRotation.y) > 180)
                {
                    revolutions += math.sign(v.y - lastRotation.y);
                }
                if (math.abs(v.z - lastRotation.z) > 180)
                {
                    revolutions += math.sign(v.z - lastRotation.z);
                }
            }
            v -= revolutions * 360;
            var x = xMapping.sqrMagnitude > 0 ? math.remap(xMapping.x, xMapping.y, xMapping.z, xMapping.w, math.dot(v, toX)) : 0;
            var y = yMapping.sqrMagnitude > 0 ? math.remap(yMapping.x, yMapping.y, yMapping.z, yMapping.w, math.dot(v, toY)) : 0;
            var z = zMapping.sqrMagnitude > 0 ? math.remap(zMapping.x, zMapping.y, zMapping.z, zMapping.w, math.dot(v, toZ)) : 0;
            if (!extrapolate)
            {
                x = math.clamp(x, math.min(xMapping.z, xMapping.w), math.max(xMapping.z, xMapping.w));
                y = math.clamp(y, math.min(yMapping.z, yMapping.w), math.max(yMapping.z, yMapping.w));
                z = math.clamp(z, math.min(zMapping.z, zMapping.w), math.max(zMapping.z, zMapping.w));
            }
            switch (destinationMapping)
            {
            case TransformMapping.Location:
                destination.SetLocalPosition(stream, offsetPos + new float3(x, y, z));
                break;

            case TransformMapping.Rotation:
                destination.SetLocalRotation(stream, Quaternion.Euler(offsetRot + new float3(x, y, z)));
                break;

            case TransformMapping.Scale:
                destination.SetLocalScale(stream, new float3(x, y, z));
                break;
            }
            lastRotation = source.GetLocalRotation(stream).eulerAngles;
        }
    }