|
resonance 1.0.1
|
Glowing ribbon with a head mesh that snakes along one lane of the tunnel. More...
#include <tnlsnake.h>
Public Member Functions | |
| TnlSnake () | |
| Build the ribbon and the head. | |
| ~TnlSnake () | |
| Take the ribbon out of "tnl transparent" and delete the ribbon and the head. | |
| void | Start (float flFrame, int nRing, const Color &color, float flPhase, float flAmplitude) |
| Show the ribbon on a lane for 11520 song frames from flFrame. | |
| void | Update (float flFrame) |
| Move the ribbon to the song frame. | |
Friends | |
| class | AppTunnel |
Glowing ribbon with a head mesh that snakes along one lane of the tunnel.
The class is not polymorphic and emits no RTTI, and no allocation tag or file path identifies it. The name is inferred from the objects it uses, "snake.mat" and "snake head.mesh".
The ribbon is a private Rnd::String of 16 points in "tnl transparent", and the head is a private copy of "snake head.mesh" drawn by the ribbon. Point i trails the head by 100 * i song frames, and each point sits on the lane at its frame, swinging on a sine of the frame. Random pulses of glow run down the ribbon and fade by 0.15 per update.
AppTunnel allocates three, 0x50 bytes each, and stores them in its vector at +0x54.
| TnlSnake::TnlSnake | ( | ) |
Build the ribbon and the head.
The ribbon and the head are named with NextAppTunnelName(). The ribbon draws with "snake.mat" at width 0.2 and starts hidden.
| TnlSnake::~TnlSnake | ( | ) |
Take the ribbon out of "tnl transparent" and delete the ribbon and the head.
| void TnlSnake::Start | ( | float | flFrame, |
| int | nRing, | ||
| const Color & | color, | ||
| float | flPhase, | ||
| float | flAmplitude ) |
Show the ribbon on a lane for 11520 song frames from flFrame.
AppTunnel inlines this, and the out-of-line copy has no caller.
| flFrame | The start frame. |
| nRing | The lane. |
| color | The ribbon colour. |
| flPhase | The phase of the swing, in radians. |
| flAmplitude | The amplitude of the swing. |
| void TnlSnake::Update | ( | float | flFrame | ) |
Move the ribbon to the song frame.
Returns at once while idle or when flFrame repeats the previous call. The head runs at four times the song speed from the start frame, and the ribbon hides once the head passes the end frame. Each point is placed at its frame, coloured with its glow added to mColor, and its glow decays. The head mesh moves to the first point. With probability 0.2 a new pulse lands on four neighbouring points.
| flFrame | The song frame. |
|
friend |