Commit becf6344 authored by Lázár Bence Kis's avatar Lázár Bence Kis
Browse files

Easing function made a little more readable

parent 7557ae3e
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -212,15 +212,14 @@ private:
            } else { // Ease out
                return std::pow(t, m_easingFactor);
            }
        } else if (m_easingFactor < 0) { // Ease in/out and out/in built from two segments
        } else if (m_easingFactor < 0) { // Ease in-out and out-in built from two segments
            if (t < 0.5) {
                return std::pow(t * 2.0_s, -m_easingFactor) * 0.5_s;
                return  0.5_s * std::pow(2.0_s * t, -m_easingFactor);
            } else {
                return (1.0_s - std::pow(1.0_s - (t - 0.5_s) * 2.0_s, -m_easingFactor)) * 0.5_s + 0.5_s;
                return -0.5_s * std::pow(2.0_s * (1 - t), -m_easingFactor) + 1.0_s;
            }
        }
        
        return t; // No easing (linear)
        return t; // No easing
    }
};