CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/Common/Math/curves.h
Views: 1401
1
#pragma once
2
3
// Easy curve computation for fades etc.
4
5
// output range: [0.0, 1.0]
6
float linearInOut(int t, int fadeInLength, int solidLength, int fadeOutLength);
7
float linearIn(int t, int fadeInLength);
8
float linearOut(int t, int fadeInLength);
9
10
// smooth operator [0, 1] -> [0, 1]
11
float ease(float val);
12
float ease(int t, int fadeLength);
13
14
float bezierEase(float val);
15
float bezierEaseInOut(float val);
16
float bezierEaseIn(float val);
17
float bezierEaseOut(float val);
18
19
// need a bouncy ease
20
21
// waveforms [0, 1]
22
float sawtooth(int t, int period);
23
24
// output range: -1.0 to 1.0
25
float passWithPause(int t, int fadeInLength, int pauseLength, int fadeOutLength);
26
27