|
resonance 1.0.1
|
Coloured particle fire that travels down the tunnel path from one lane. More...
#include <tnlfirefx.h>
Public Member Functions | |
| TnlFireFX (const HxStr &name, int nIndex) | |
| Resolve the path, the view, and the systems of one fire. | |
| int | Start (float flPathStart, int nIndex, int nSlot, const Color &color, const Color &altColor, float flPathEnd) |
| Start the fire if it is idle and nIndex selects it. | |
| void | SetFrame (float flFrame, float flViewFrame) |
| Drive the view and advance the path. | |
Coloured particle fire that travels down the tunnel path from one lane.
The class is not polymorphic and emits no RTTI, and no allocation tag or file path identifies it. The name is inferred from the name prefixes AppTunnel builds these with, "fire%d", "firefs%d", and "firemult%d", and from the shared path "fx.path".
Each object resolves "<name>.view" and "<name>.ps". The "fire%d" objects, built with an index of -1, also resolve "<name>a.ps". Start() colours the systems, turns them to face a lane, and runs "fx.path" forward at four path frames per song frame until the path passes its end frame.
AppTunnel allocates these in three groups, 0x70 bytes each, and stores them in its vector at +0x24. The group built with the name "fire%d" passes -1, "firefs%d" passes -2, and "firemult%d" passes the loop index.
| TnlFireFX::TnlFireFX | ( | const HxStr & | name, |
| int | nIndex ) |
Resolve the path, the view, and the systems of one fire.
| name | The name prefix. |
| nIndex | The index Start() must be given, -1 when the object has a second system. |
| int TnlFireFX::Start | ( | float | flPathStart, |
| int | nIndex, | ||
| int | nSlot, | ||
| const Color & | color, | ||
| const Color & | altColor, | ||
| float | flPathEnd ) |
Start the fire if it is idle and nIndex selects it.
Each system spawns white and fades from its colour at full alpha to the same colour at zero alpha. Both systems are turned by -nSlot eighths of a turn about Y, and each recorded force is turned by that rotation composed with the path basis at flPathStart. The path then runs from flPathStart and the fire ends once it passes flPathEnd.
| flPathStart | The first path frame. |
| nIndex | The index this call is for. |
| nSlot | The lane the fire faces. |
| color | The colour of the first system. |
| altColor | The colour of the second system. |
| flPathEnd | The path frame that ends the fire. |
| void TnlFireFX::SetFrame | ( | float | flFrame, |
| float | flViewFrame ) |
Drive the view and advance the path.
The first call after Start() records flFrame as the reference. While the fire runs, the path is attached to the view and driven to flPathStart + (flFrame - reference) * 4.
| flFrame | The current frame. |
| flViewFrame | The frame the view is driven to. |