wavelength 1.0.0
Loading...
Searching...
No Matches
beamparams.h
Go to the documentation of this file.
1#pragma once
2
3#include "math/color.h"
4#include "math/vector2.h"
5#include "os/string.h"
6#include "rnd/rndline.h"
7#include "rnd/rndmat.h"
8#include "script/dataarray.h"
9
16public:
18 enum End {
21 };
22
30 explicit BeamParams(const char *pszName);
31
39
50 void Load(DataArray *pConfig, DataArray *pDefaults, bool bReload, float fScale);
51
60 void Apply(RndLine *pLine, RndMat *pMat) const;
61
71 const Color *GetColor(int nEnd, const Color *pDefault) const;
72
74 int GetPoints() const {
75 return mPoints;
76 }
77
79 const Vector2 &GetMinFrequency() const {
80 return mMinFrequency;
81 }
82
84 const Vector2 &GetMaxFrequency() const {
85 return mMaxFrequency;
86 }
87
89 const Vector2 &GetMinTravelPeriod() const {
90 return mMinTravelPeriod;
91 }
92
94 const Vector2 &GetMaxTravelPeriod() const {
95 return mMaxTravelPeriod;
96 }
97
104 float GetAmplitude(int nEnd) const {
105 return mAmplitudes[nEnd];
106 }
107
108private:
109 String mName;
110 int mPoints;
111 float mWidth;
112 float mFoldAngle;
113 RndMat *mMat;
114 Color mColors[2];
115 float mAmplitudes[2];
116 Vector2 mMinFrequency;
117 Vector2 mMaxFrequency;
118 Vector2 mMinTravelPeriod;
119 Vector2 mMaxTravelPeriod;
120};
End
The ends of a beam, the indices of mColors.
Definition beamparams.h:18
@ kEndStart
Definition beamparams.h:19
@ kEndFinish
Definition beamparams.h:20
const Vector2 & GetMaxTravelPeriod() const
Definition beamparams.h:94
void Load(DataArray *pConfig, DataArray *pDefaults, bool bReload, float fScale)
Read the look from the beams entry of the configuration.
float GetAmplitude(int nEnd) const
Report the amplitude of the waves at one end.
Definition beamparams.h:104
int GetPoints() const
Definition beamparams.h:74
const Vector2 & GetMaxFrequency() const
Definition beamparams.h:84
void Apply(RndLine *pLine, RndMat *pMat) const
Give the look to the line and the material of a beam, once the look is loaded.
BeamParams(const char *pszName)
Construct the look of the beams of a configuration entry.
~BeamParams()
Destroy the look.
const Vector2 & GetMinFrequency() const
Definition beamparams.h:79
const Color * GetColor(int nEnd, const Color *pDefault) const
Report the colour of an end of a beam.
const Vector2 & GetMinTravelPeriod() const
Definition beamparams.h:89
Reference-counted array of script data nodes.
Definition dataarray.h:20
Line through points, drawn as a ribbon of constant screen width that faces the camera.
Definition rndline.h:26
Surface description: blending, lighting colours, culling, and a list of texture stages.
Definition rndmat.h:20
Growable text buffer that is also a PrnStream.
Definition string.h:19
Linear colour with four float components.
Definition color.h:12
Two-component vector, used for texture coordinates.
Definition vector2.h:12