Etterna 0.74.4
Loading...
Searching...
No Matches
ArrowEffects.h
1#ifndef ARROWEFFECTS_H
2#define ARROWEFFECTS_H
3
4#include "RageUtil/Misc/RageTypes.h"
5
6class PlayerState;
7class PlayerOptions;
11{
12 public:
13 static void Update();
14 // SetCurrentOptions and the hidden static variable it set exists so that
15 // ArrowEffects doesn't have to reach through the PlayerState to check
16 // every option. Also, it will make it easier to implement per-column
17 // mods later. -Kyz
18 static void SetCurrentOptions(const PlayerOptions* options);
19
20 // fYOffset is a vertical position in pixels relative to the center
21 // (positive if has not yet been stepped on, negative if has already
22 // passed). The ArrowEffect and ScrollSpeed is applied in this stage.
23 static auto GetYOffset(const PlayerState* pPlayerState,
24 int iCol,
25 float fNoteBeat,
26 float& fPeakYOffsetOut,
27 bool& bIsPastPeakYOffset,
28 bool bAbsolute = false) -> float;
29 static auto GetYOffset(const PlayerState* pPlayerState,
30 int iCol,
31 float fNoteBeat,
32 bool bAbsolute = false) -> float
33 {
34 float fThrowAway;
35 bool bThrowAway;
36 return GetYOffset(
37 pPlayerState, iCol, fNoteBeat, fThrowAway, bThrowAway, bAbsolute);
38 }
39
40 static void GetXYZPos(const PlayerState* player_state,
41 int col,
42 float y_offset,
43 float y_reverse_offset,
44 RageVector3& ret,
45 bool with_reverse = true)
46 {
47 ret.x = GetXPos(player_state, col, y_offset);
48 ret.y = GetYPos(col, y_offset, y_reverse_offset, with_reverse);
49 ret.z = GetZPos(col, y_offset);
50 }
51
62 static auto GetYPos(int iCol,
63 float fYOffset,
64 float fYReverseOffsetPixels,
65 bool WithReverse = true) -> float;
66
67 // Inverse of ArrowGetYPos (YPos -> fYOffset).
68 static auto GetYOffsetFromYPos(int iCol,
69 float YPos,
70 float fYReverseOffsetPixels) -> float;
71
72 // fRotation is Z rotation of an arrow. This will depend on the column of
73 // the arrow and possibly the Arrow effect and the fYOffset (in the case of
74 // EFFECT_DIZZY).
75 static auto GetRotationZ(const PlayerState* pPlayerState,
76 float fNoteBeat,
77 bool bIsHoldHead) -> float;
78 static auto ReceptorGetRotationZ(const PlayerState* pPlayerState) -> float;
79
80 // Due to the handling logic for holds on Twirl, we need to use an offset
81 // instead. It's more intuitive for Roll to be based off offset, so use an
82 // offset there too.
83 static auto GetRotationX(float fYOffset) -> float;
84 static auto GetRotationY(float fYOffset) -> float;
85
86 // fXPos is a horizontal position in pixels relative to the center of the
87 // field. This depends on the column of the arrow and possibly the Arrow
88 // effect and fYPos (in the case of EFFECT_DRUNK).
89 static auto GetXPos(const PlayerState* pPlayerState,
90 int iCol,
91 float fYOffset) -> float;
92
100 static auto GetZPos(int iCol, float fYPos) -> float;
101
102 // Enable this if any ZPos effects are enabled.
103 static auto NeedZBuffer() -> bool;
104
105 // fAlpha is the transparency of the arrow. It depends on fYPos and the
106 // AppearanceType.
107 static auto GetAlpha(int iCol,
108 float fYPos,
109 float fPercentFadeToFail,
110 float fYReverseOffsetPixels,
111 float fDrawDistanceBeforeTargetsPixels,
112 float fFadeInPercentOfDrawFar) -> float;
113
114 // fAlpha is the transparency of the arrow. It depends on fYPos and the
115 // AppearanceType.
116 static auto GetGlow(int iCol,
117 float fYPos,
118 float fPercentFadeToFail,
119 float fYReverseOffsetPixels,
120 float fDrawDistanceBeforeTargetsPixels,
121 float fFadeInPercentOfDrawFar) -> float;
122
130 static auto GetBrightness(const PlayerState* pPlayerState, float fNoteBeat)
131 -> float;
132
133 // This is the zoom of the individual tracks, not of the whole Player.
134 static auto GetZoom(const PlayerState* pPlayerState) -> float;
135
136 static auto GetFrameWidthScale(const PlayerState* pPlayerState,
137 float fYOffset,
138 float fOverlappedTime) -> float;
139};
140
141#endif
Functions that return properties of arrows based on Style and PlayerOptions.
Definition ArrowEffects.h:11
static auto GetBrightness(const PlayerState *pPlayerState, float fNoteBeat) -> float
Retrieve the current brightness.
Definition ArrowEffects.cpp:874
static auto GetZPos(int iCol, float fYPos) -> float
Retrieve the Z position.
Definition ArrowEffects.cpp:885
static auto GetYPos(int iCol, float fYOffset, float fYReverseOffsetPixels, bool WithReverse=true) -> float
Retrieve the actual display position.
Definition ArrowEffects.cpp:498
Per-player options that are not saved between sessions.
Definition PlayerOptions.h:48
The player's indivdual state.
Definition PlayerState.h:30
Definition RageTypes.h:172