resonance 1.0.1
Loading...
Searching...
No Matches
tnlpanelfx.h
Go to the documentation of this file.
1#pragma once
2
3#include "math/vector3.h"
4#include "rnd/mesh.h"
5#include "rnd/view.h"
6
7namespace Rnd {
8class Mat;
9} // namespace Rnd
10
26public:
39 explicit TnlPanelFX(int nIndex);
40
50 mView->RemoveDraw(mMesh);
51 delete mMesh;
52 }
53
67 void Start(int nRing, int nSlice, int nForward);
68
82 void Update(float flFrame);
83
92 bool IsIdle() const {
93 return mState == kStateIdle;
94 }
95
96private:
97 // Phase Update() runs. Idle is hidden and waiting for Start(), rise slides into the wall and
98 // fades in, hold shows with an additive blend, and fade fades out.
99 enum State { kStateIdle = 0, kStateRise = 1, kStateHold = 2, kStateFade = 3 };
100
101 float mStateFrame; // Frame the current phase began. Starts at 1e9.
102 State mState;
103 int mIndex;
104 float mDirection; // 1 or -1, from Start().
105 Vector3 mOffset; // Start offset of the rise, before mDirection applies.
106 Rnd::Mesh *mMesh;
107 Rnd::Mat *mMat;
108 Rnd::View *mView; // "tnl transparent".
109};
Surface description a Rnd::Mesh draws with.
Definition mat.h:36
~TnlPanelFX()
Take the mesh out of "tnl transparent" and delete it.
Definition tnlpanelfx.h:49
bool IsIdle() const
Report whether the panel waits for Start().
Definition tnlpanelfx.h:92
void Start(int nRing, int nSlice, int nForward)
Show the panel over one ring section and begin the rise phase.
void Update(float flFrame)
Advance the phase the panel is in.
TnlPanelFX(int nIndex)
Build the panel mesh and resolve the material for one panel slot.
The rendering engine.
Definition animhelper.h:3