MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ set_falloff_curve()

void MayaFlux::Nexus::Presence::set_falloff_curve ( FalloffCurve  curve)

Set the falloff curve to a named built-in.

Definition at line 39 of file Presence.cpp.

40{
41 m_falloff_curve = curve;
42 switch (curve) {
44 m_falloff = [](float t) { return 1.0F - std::clamp(t, 0.0F, 1.0F); };
45 break;
47 m_falloff = [](float t) { return 0.5F * (1.0F + std::cos(std::clamp(t, 0.0F, 1.0F) * glm::pi<float>())); };
48 break;
50 m_falloff = [](float t) { return std::exp(-4.0F * std::clamp(t, 0.0F, 1.0F)); };
51 break;
53 m_falloff = [](float t) { const float c = std::clamp(t, 0.0F, 1.0F); return 1.0F / (1.0F + 16.0F * c * c); };
54 break;
55 }
56}
std::optional< FalloffCurve > m_falloff_curve
Definition Presence.hpp:166

References Cosine, Exponential, InverseSquare, Linear, m_falloff, and m_falloff_curve.