resonance 1.0.1
Loading...
Searching...
No Matches
tnlpointer.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "app/linearanim.h"
6#include "os/hxstr.h"
7
8namespace Rnd {
9class Mesh;
10class View;
11} // namespace Rnd
12
27public:
33 class MeshPair {
34 public:
45 void Init(const HxStr &iconName, const HxStr &baseName);
46
56 void SetShowing(int nShowing);
57
67 void SetAlpha(float flAlpha);
68
71 };
72
80 explicit TnlPointer(const HxStr &colorName);
81
92 void SetKind(int nKind);
93
100 void Reset();
101
111 void Spin(int nRestart);
112
123 void SetLane(float flLane);
124
134 void SetAlpha(float flAlpha);
135
145 void AttachTo(Rnd::View *pParent);
146
156 void Update(float flTime);
157
158private:
159 std::vector<MeshPair> mPairs;
160 Rnd::View *mView; // "ptr_<c>", whose animation is the spin.
161 Rnd::View *mSpinView; // "ptr_<c>_spin.view", whose translation is the dip.
162 float mLastTime;
163 float mSpinFrame;
164 int mSpinning;
165 float mOffsetX;
166 LinearAnim mDip;
167 float mCentreOffset; // +0x3c, set to 0.5 and never read by the recovered routines.
168 float mSpinStart; // 1e9 while no spin runs, -1e9 while a restart is pending.
169};
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Value that moves toward a target at a fixed rate, read through a linear mapping.
Definition linearanim.h:12
Indexed triangle mesh with one material.
Definition mesh.h:46
Root of a loadable scene.
Definition view.h:47
Icon and base mesh of one instrument kind, 8 bytes.
Definition tnlpointer.h:33
void Init(const HxStr &iconName, const HxStr &baseName)
Resolve both meshes.
Rnd::Mesh * mIcon
Definition tnlpointer.h:69
Rnd::Mesh * mBase
Definition tnlpointer.h:70
void SetShowing(int nShowing)
Show or hide both meshes.
void SetAlpha(float flAlpha)
Set the alpha of the icon mesh's material.
void AttachTo(Rnd::View *pParent)
Parent the pointer view to another view for both transform and drawing.
void Update(float flTime)
Advance the dip ramp and the spin.
void SetAlpha(float flAlpha)
Set the alpha of every icon mesh's material.
TnlPointer(const HxStr &colorName)
Resolve the views and the three mesh pairs, and stop the spin.
void SetKind(int nKind)
Show the mesh pair of one instrument kind and stop the spin.
void SetLane(float flLane)
Set the sideways offset of the spin view from a lane position.
void Spin(int nRestart)
Drop the pointer at once and spin it.
void Reset()
Stop the spin and send the dip ramp back to rest.
The rendering engine.
Definition animhelper.h:3