Ejemplo n.º 1
0
    private Matrix4x4 Interp(float t, Matrix4x4 a, Matrix4x4 b)
    {
        Matrix4x4 matrixx;

        switch (this.mode)
        {
        case SlerpMode.TransformLerp:
        case SlerpMode.WorldToCameraLerp:
        case SlerpMode.CameraToWorldLerp:
            matrixx = TransitionFunctions.Linear(t, a, b);
            break;

        case SlerpMode.WorldToCameraSlerp2:
            matrixx = TransitionFunctions.SlerpWorldToCamera(t, a, b);
            break;

        default:
            matrixx = TransitionFunctions.Slerp(t, a, b);
            break;
        }
        if (this.inverse0)
        {
            if (this.transpose)
            {
                if (!this.inverse1)
                {
                    return(matrixx.inverse.transpose);
                }
                return(matrixx.inverse.transpose.inverse);
            }
            if (this.inverse1)
            {
                return(matrixx.inverse.inverse);
            }
            return(matrixx.inverse);
        }
        if (this.transpose)
        {
            if (this.inverse1)
            {
                return(matrixx.transpose.inverse);
            }
            return(matrixx.transpose);
        }
        if (this.inverse1)
        {
            return(matrixx.inverse);
        }
        return(matrixx);
    }
Ejemplo n.º 2
0
        public int Update(ref Matrix4x4G currentView, ref Matrix4x4G currentProj)
        {
            int num;

            try
            {
                float single = CameraFX.CameraTransitionData.timeSource;
                if (this.end > single)
                {
                    float single1 = Mathf.InverseLerp(this.start, this.end, single);
                    if (single1 < 1f)
                    {
                        single1 = this.func.Evaluate(single1);
                        Matrix4x4G camera     = TransitionFunctions.SlerpWorldToCamera((double)single1, this.view, currentView);
                        Matrix4x4G matrix4x4G = TransitionFunctions.Linear((double)single1, this.proj, currentProj);
                        this.lastTime = single;
                        if (!Matrix4x4G.Equals(ref camera, ref currentView))
                        {
                            currentView = camera;
                            if (Matrix4x4G.Equals(ref matrix4x4G, ref currentProj))
                            {
                                num = 1;
                                return(num);
                            }
                            else
                            {
                                currentProj = matrix4x4G;
                                num         = 3;
                                return(num);
                            }
                        }
                        else if (!Matrix4x4G.Equals(ref matrix4x4G, ref currentProj))
                        {
                            currentProj = matrix4x4G;
                            num         = 2;
                            return(num);
                        }
                    }
                }
                num = 0;
            }
            finally
            {
                this.lastView = currentView;
                this.lastProj = currentProj;
            }
            return(num);
        }
Ejemplo n.º 3
0
        public int Update(ref Matrix4x4G currentView, ref Matrix4x4G currentProj)
        {
            int num3;

            try
            {
                float timeSource = CameraFX.CameraTransitionData.timeSource;
                if (this.end > timeSource)
                {
                    float t = Mathf.InverseLerp(this.start, this.end, timeSource);
                    if (t < 1f)
                    {
                        t = this.func.Evaluate(t);
                        Matrix4x4G a         = TransitionFunctions.SlerpWorldToCamera((double)t, this.view, currentView);
                        Matrix4x4G matrixxg2 = TransitionFunctions.Linear((double)t, this.proj, currentProj);
                        this.lastTime = timeSource;
                        if (!Matrix4x4G.Equals(ref a, ref currentView))
                        {
                            currentView = a;
                            if (!Matrix4x4G.Equals(ref matrixxg2, ref currentProj))
                            {
                                currentProj = matrixxg2;
                                return(3);
                            }
                            return(1);
                        }
                        if (!Matrix4x4G.Equals(ref matrixxg2, ref currentProj))
                        {
                            currentProj = matrixxg2;
                            return(2);
                        }
                    }
                }
                num3 = 0;
            }
            finally
            {
                this.lastView = currentView;
                this.lastProj = currentProj;
            }
            return(num3);
        }
Ejemplo n.º 4
0
    private Matrix4x4 Interp(float t, Matrix4x4 a, Matrix4x4 b)
    {
        Matrix4x4 camera;

        switch (this.mode)
        {
        case TransformLerpTest.SlerpMode.TransformSlerp:
        case TransformLerpTest.SlerpMode.WorldToCameraSlerp:
        case TransformLerpTest.SlerpMode.CameraToWorldSlerp:
        {
            camera = TransitionFunctions.Slerp(t, a, b);
            break;
        }

        case TransformLerpTest.SlerpMode.TransformLerp:
        case TransformLerpTest.SlerpMode.WorldToCameraLerp:
        case TransformLerpTest.SlerpMode.CameraToWorldLerp:
        {
            camera = TransitionFunctions.Linear(t, a, b);
            break;
        }

        case TransformLerpTest.SlerpMode.WorldToCameraSlerp2:
        {
            camera = TransitionFunctions.SlerpWorldToCamera(t, a, b);
            break;
        }

        default:
        {
            goto case TransformLerpTest.SlerpMode.CameraToWorldSlerp;
        }
        }
        if (!this.inverse0)
        {
            if (!this.transpose)
            {
                if (!this.inverse1)
                {
                    return(camera);
                }
                return(camera.inverse);
            }
            if (!this.inverse1)
            {
                return(camera.transpose);
            }
            return(camera.transpose.inverse);
        }
        if (!this.transpose)
        {
            if (!this.inverse1)
            {
                return(camera.inverse);
            }
            return(camera.inverse.inverse);
        }
        if (!this.inverse1)
        {
            return(camera.inverse.transpose);
        }
        return(camera.inverse.transpose.inverse);
    }