22 extern bool globWarningFlag;
23 extern bool globReportFlag;
27 Moveable(), owner_(room), mirrors_(mirrors)
35 directivityFlag_ =
false;
37 directivityTbl_.resize(361, 1.0f);
43 for (std::vector<double>::iterator iter = directivityTbl_.begin(); iter != directivityTbl_.end(); iter++, n++)
45 *iter = (*((*tbl) + n)) * 0.0001;
47 post(
"directTbl[%d]: %f", n, *iter);
55 if (angle >= 0 && angle < 361)
57 return directivityTbl_[angle];
62 error(
"Angle out of bounds for directivity table.");
70 if (angle >= 0 && angle < 360)
105 else if (globWarningFlag)
106 post(
"Source angle must be between 0 and 360.");
116 post(
"SourcePos= X: %f,Y: %f,Z: %f,Orientation: %ld",
xPos(),
yPos(),
zPos(), aziAngle_);
126 else if (globWarningFlag)
127 post(
"source exceeds room");
137 else if (globWarningFlag)
138 post(
"source exceeds room");
148 else if (globWarningFlag)
149 post(
"source exceeds room");
154 if (newXPos < 1 && newXPos > -1)
159 else if (globWarningFlag)
160 post(
"source exceeds room");
165 if (newYPos < 1 && newYPos > -1)
170 else if (globWarningFlag)
171 post(
"source exceeds room");
176 if (newZPos < 1 && newZPos > -1)
181 else if (globWarningFlag)
182 post(
"source exceeds room");
186 void Source::notifyRoom()
194 return directivityFlag_;
199 directivityFlag_ = newFlag;
void updateDirectivity(long **tbl)
Set directivity table to values obtained from the Max patch.
long aziAngle() const
Get azimuth angle.
bool directivityFlag() const
True if the source's directivity is to be taken into account, false otherwise.
virtual void printPos() const
Post xyz position.
void sourceChanged()
Allows source to notify mirror that it has changed.
double xPos() const
Get x position.
double halfWidth() const
Get half width.
void yPosAbs(double yPos)
Set y position in meters.
Source(Room &room, Mirror *mirrors)
Class constructor, taking the Room to which the source belongs, as well as a pointer to the acoustic ...
bool flag() const
True if object has moved.
double directivityAt(long angle) const
Retrieve directivity gain for a given angle.
void xPosAbs(double xPos)
Set x position in meters.
double zPos() const
Get z position.
void yPosRel(double yPos)
Set y position relative to room depth (0.0 to 1.0).
double halfDepth() const
Get half depth.
void aziAngle(long angle)
Set azimuth angle.
void zPosRel(double zPos)
Set z position relative to room height (0.0 to 1.0).
double yPos() const
Get y position.
double halfHeight() const
Get half height.
void zPosAbs(double zPos)
Set z position in meters.
void xPosRel(double xPos)
Set x position relative to room width (0.0 to 1.0).