wavelength 1.0.0
Loading...
Searching...
No Matches
tnlwave.h
Go to the documentation of this file.
1#pragma once
2
3#include "os/string.h"
4
11class TnlWave {
12public:
22 explicit TnlWave(const char *pszName);
23
33 TnlWave(float flAmplitude, float flFrequency, float flPhase);
34
42
51 void Sync(float flTime, float flPhase);
52
61 float Sine(float flTime) const;
62
64 float GetAmplitude() const {
65 return mAmplitude;
66 }
67
69 void SetAmplitude(float flAmplitude) {
70 mAmplitude = flAmplitude;
71 }
72
74 void SetFrequency(float flFrequency) {
75 mFrequency = flFrequency;
76 }
77
79 void SetPhase(float flPhase) {
80 mPhase = flPhase;
81 }
82
83private:
84 String mName;
85 float mAmplitude;
86 float mFrequency;
87 float mPhase;
88};
Growable text buffer that is also a PrnStream.
Definition string.h:19
void SetAmplitude(float flAmplitude)
Definition tnlwave.h:69
TnlWave(float flAmplitude, float flFrequency, float flPhase)
Construct an unnamed wave.
void SetPhase(float flPhase)
Definition tnlwave.h:79
void SetFrequency(float flFrequency)
Definition tnlwave.h:74
TnlWave(const char *pszName)
Construct a wave with only a name.
void Sync(float flTime, float flPhase)
Choose the phase that gives the wave a phase at a time.
float Sine(float flTime) const
Report the sine of the wave at a time.
~TnlWave()
Release the name.
float GetAmplitude() const
Definition tnlwave.h:64