Jamoma API  0.6.0.a19
Mirror.cpp
1 // Mirror.cpp
2 /***************************************************/
3 /*! \class Mirror
4  \brief Sound mirror class
5 
6  This class implements a sound mirror, which reflects
7  sound that originates at either a sound source or another
8  mirror.
9 
10  by Tristan Matthews and Nils Peters, 2007-2008.
11  */
12 /***************************************************/
13 
14 #include "Mirror.h"
15 #include "Coordinate.h"
16 #include "Moveable.h"
17 #include "Properties.h"
18 #include "ext.h"
19 
20 extern bool globWarningFlag;
21 
23 {
24  order_ = 0; // direct sound by default
25  aziAngle_ = 0;
26 }
27 
28 short Mirror::order() const
29 {
30  return order_;
31 }
32 
33 void Mirror::printPos() const
34 {
35  post("/MirrorPos: %f, %f, %f", xPos(), yPos(), zPos());
36 }
37 
38 void Mirror::order(short newOrder)
39 {
40  if (newOrder >= 0 && newOrder < Properties::REFLECTIONORDER)
41  order_ = newOrder;
42  else if (globWarningFlag)
43  post("Mirror: order must be between %d and %d", 0, Properties::REFLECTIONORDER - 1);
44 }
45 
46 void Mirror::aziAngle(long angle)
47 {
48  if (angle >= 0 && angle < 360)
49  {
50  aziAngle_ = angle;
51  flag(true);
52  }
53  else if (globWarningFlag)
54  post("Mirror angle must be between 0 and 360.");
55 }
56 
57 long Mirror::aziAngle() const
58 {
59  return aziAngle_;
60 }
61 
62 // vim:sw=4:et:cindent:
Mirror()
Class constructor.
Definition: Mirror.cpp:22
double xPos() const
Get x position.
Definition: Moveable.cpp:26
virtual void printPos() const
Print xyz position.
Definition: Mirror.cpp:33
bool flag() const
True if object has moved.
Definition: Moveable.cpp:65
long aziAngle() const
Get azimuth angle.
Definition: Mirror.cpp:57
double zPos() const
Get z position.
Definition: Moveable.cpp:52
Moveable class.
Definition: Moveable.h:18
short order() const
Get order.
Definition: Mirror.cpp:28
double yPos() const
Get y position.
Definition: Moveable.cpp:39