resonance 1.0.1
Loading...
Searching...
No Matches
tnlseekerfade.h
Go to the documentation of this file.
1#pragma once
2
3#include "math/color.h"
4
20public:
32 TnlSeekerFade(int nIndex, const Color &color);
33
42 void SetActive(int nActive);
43
54 void Update();
55
66 void SetRange(int nFirstSlice, int nSliceCount, int nRing) {
67 if ((nFirstSlice != mFirstSlice) || (nSliceCount != mSliceCount) || (nRing != mRing)) {
68 mFirstSlice = nFirstSlice;
69 mFadeRate = kFadeOutRate;
70 mSliceCount = nSliceCount;
71 mRing = nRing;
72 }
73 }
74
81 void ClearRange() {
82 if (mSliceCount != 0) {
83 mSliceCount = 0;
84 mFadeRate = kFadeOutRate;
85 }
86 }
87
88private:
89 // Alpha removed per update while the seeker fades out for a range change.
90 static constexpr float kFadeOutRate = -0.2f;
91
92public:
93 // Public because the seeker script command reads and writes them with no accessor in the
94 // image.
98 int mRing;
99
100private:
101 Color mColor;
102 float mFadeRate;
103
104public:
105 // Public because the seeker script command reads it with no accessor in the image.
107};
int mFirstSlice
Definition tnlseekerfade.h:96
void Update()
Advance the alpha by mFadeRate, clamped to 0 through 1.
int mIndex
Definition tnlseekerfade.h:106
void SetActive(int nActive)
Apply the stored range to the seeker, or an empty range.
int mSliceCount
Definition tnlseekerfade.h:97
void ClearRange()
Drop the recorded range and fade the seeker out.
Definition tnlseekerfade.h:81
int mActive
Definition tnlseekerfade.h:95
void SetRange(int nFirstSlice, int nSliceCount, int nRing)
Record a new seeker range and fade the seeker out so that Update() brings it back there.
Definition tnlseekerfade.h:66
int mRing
Definition tnlseekerfade.h:98
TnlSeekerFade(int nIndex, const Color &color)
Give the seeker its material and colour and apply an empty range.
Linear colour with four float components.
Definition color.h:10