]> icculus.org git repositories - divverent/nexuiz.git/blob - scmenu/source/control/_fx/fx.qh
restructure
[divverent/nexuiz.git] / scmenu / source / control / _fx / fx.qh
1 // DP/Nex Menu
2 // control/fx/fx.qh
3
4 // [Item_Changer]
5
6 // An effect always affects its parent
7 // There are two kinds of effects periodic/loop effects and task-effects
8 // The difference is that a task-effect will be finished somewhen and then deactivate/remove itself
9 // while a loop effect will restart
10 // A loop task will have deltaTime2 set
11
12 enum {
13         ITEM_STATE_FORWARD,
14         ITEM_STATE_BACKWARD
15 };
16
17 // [Item_Effect]
18 // deltaTime2 = -1 for a task effect
19 // deltaTime2 = -2 for a persistent task effect
20 // endTime = -1 for a infinite loop effect
21 .vector time; // <deltaTime1, deltaTime2, endTime>
22
23 .union {
24         .vector targetVector;
25         .float  targetFloat;
26 };
27 /*
28 .union {
29         struct {
30                 vector startVector;
31                 float startFloat;
32         };
33         struct {
34                 vector endVector;
35                 float endFloat;
36         };
37 };*/
38 .float startFloat;
39 .vector startVector;
40 .float endFloat;
41 .vector endVector;
42
43 .float _state;
44 .float _presstime;
45
46 // returns new value
47 typedef float( float pStart, float pEnd, float pDeltaTime, float pT, float pValue ) InterpolFunction;
48
49 .InterpolFunction interpolForward;
50 .InterpolFunction interpolBackward;
51
52 // Item_Effect_Float
53 // Item_Effect_Vector
54
55 void() Item_Effect_Vector_Reinit;
56 void() Item_Effect_Vector_Update;
57 void() Item_Effect_Vector_Spawn;
58
59 // Interpolation functions
60 float( float pStart, float pEnd, float pDeltaTime, float pT, float pValue ) FX_LinearInterpolation;
61 float( float pStart, float pEnd, float pDeltaTime, float pT, float pValue ) FX_SquareInterpolation;