Euphoria
scurve.h
Go to the documentation of this file.
1#pragma once
2
3namespace eu::core
4{
5
14struct SCurve
15{
16 float slope = 1.0f;
17 float threshold = 0.75f;
18
19 constexpr SCurve() = default;
20
21 constexpr SCurve(float s, float t)
22 : slope(s)
23 , threshold(t)
24 {}
25
26 // todo(Gustav): give a better name
27 constexpr static SCurve light_curve()
28 {
29 return {5.0f, 1.0f};
30 }
31};
32
37SCurve s_curve_from_input(float x, float y);
38
44float calculate_s_curve(float x, float slope, float threshold);
45
50} // namespace klotter
SCurve s_curve_from_input(float x, float y)
Generate an S-Curve from user input.
float calculate_s_curve(float x, float slope, float threshold)
Calculates an S-Curve.
A (inclusive) range between two values.
Definition range.h:19
Contains the parameters for an S-Curve.
Definition scurve.h:15
static constexpr SCurve light_curve()
Definition scurve.h:27
float slope
>=0
Definition scurve.h:16
constexpr SCurve(float s, float t)
Definition scurve.h:21
constexpr SCurve()=default
float threshold
[0,1]
Definition scurve.h:17