diff --git a/reaction/code/game/bg_misc.c b/reaction/code/game/bg_misc.c index 48363257..d02ce9db 100644 --- a/reaction/code/game/bg_misc.c +++ b/reaction/code/game/bg_misc.c @@ -1816,3 +1816,8 @@ float SawTooth(int time, int period) return 1.0f - (time % period) / ((float)period); } } + +float SmoothLerp(float x) +{ + return x * x * (3.f - 2.f * x); +} diff --git a/reaction/code/game/bg_public.h b/reaction/code/game/bg_public.h index 15a3abdd..9954c36f 100644 --- a/reaction/code/game/bg_public.h +++ b/reaction/code/game/bg_public.h @@ -1628,6 +1628,7 @@ int GetMaterialFromFlag(int flag); float SawTooth(int time, int period); +float SmoothLerp(float x); #define PULSE_SAWTOOTH_PERIOD 500 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))