Xonotic
easing.qc File Reference
#include "easing.qh"
#include "../menu.qh"
#include "keyframe.qh"
+ Include dependency graph for easing.qc:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

float easingLinear (float tickTime, float animDuration, float animStart, float animDelta)
 
float easingQuadIn (float tickTime, float animDuration, float animStart, float animDelta)
 
float easingQuadInOut (float tickTime, float animDuration, float animStart, float animDelta)
 
float easingQuadOut (float tickTime, float animDuration, float animStart, float animDelta)
 
entity makeEasing (entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animStartTime, float animDuration, float animStartValue, float animEnd)
 
entity makeHostedEasing (entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animDuration, float animStartValue, float animEnd)
 

Function Documentation

◆ easingLinear()

float easingLinear ( float  tickTime,
float  animDuration,
float  animStart,
float  animDelta 
)

Definition at line 31 of file easing.qc.

32  {
33  return (animDelta * (tickTime / animDuration)) + animStart;
34  }

◆ easingQuadIn()

float easingQuadIn ( float  tickTime,
float  animDuration,
float  animStart,
float  animDelta 
)

Definition at line 36 of file easing.qc.

Referenced by easingQuadInOut().

37  {
38  float frac = tickTime / animDuration;
39  return (animDelta * frac * frac) + animStart;
40  }
+ Here is the caller graph for this function:

◆ easingQuadInOut()

float easingQuadInOut ( float  tickTime,
float  animDuration,
float  animStart,
float  animDelta 
)

Definition at line 48 of file easing.qc.

References easingQuadIn(), and easingQuadOut().

49  {
50  if (tickTime < (animDuration / 2)) return easingQuadIn(tickTime, (animDuration / 2), animStart, (animDelta / 2));
51  else return easingQuadOut((tickTime - (animDuration / 2)), (animDuration / 2), (animStart + (animDelta / 2)), (animDelta / 2));
52  }
float easingQuadIn(float tickTime, float animDuration, float animStart, float animDelta)
Definition: easing.qc:36
float easingQuadOut(float tickTime, float animDuration, float animStart, float animDelta)
Definition: easing.qc:42
+ Here is the call graph for this function:

◆ easingQuadOut()

float easingQuadOut ( float  tickTime,
float  animDuration,
float  animStart,
float  animDelta 
)

Definition at line 42 of file easing.qc.

Referenced by easingQuadInOut(), and Slider_setValue_allowAnim().

43  {
44  float frac = tickTime / animDuration;
45  return (-animDelta * frac * (frac - 2)) + animStart;
46  }
+ Here is the caller graph for this function:

◆ makeEasing()

entity makeEasing ( entity  obj,
void(entity, float objSetter,
float(float, float, float, float func,
float  animStartTime,
float  animDuration,
float  animStartValue,
float  animEnd 
)

Definition at line 13 of file easing.qc.

References entity(), METHOD, and NEW.

Referenced by makeHostedEasing(), and makeKeyframe().

14  {
15  entity this = NEW(Easing);
16  this.configureAnimation(this, obj, objSetter, animStartTime, animDuration, animStartValue, animEnd);
17  this.setMath(this, func);
18  return this;
19  }
#define NEW(cname,...)
Definition: oo.qh:105
entity() spawn
Definition: easing.qh:10
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeHostedEasing()

entity makeHostedEasing ( entity  obj,
void(entity, float objSetter,
float(float, float, float, float func,
float  animDuration,
float  animStartValue,
float  animEnd 
)

Definition at line 6 of file easing.qc.

References anim, entity(), makeEasing(), and time.

Referenced by Slider_setValue_allowAnim().

7  {
8  entity this = makeEasing(obj, objSetter, func, time, animDuration, animStartValue, animEnd);
9  anim.addAnim(anim, this);
10  return this;
11  }
entity makeEasing(entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animStartTime, float animDuration, float animStartValue, float animEnd)
Definition: easing.qc:13
entity() spawn
float time
Definition: csprogsdefs.qc:16
+ Here is the call graph for this function:
+ Here is the caller graph for this function: