CSL  5.2
ShoeBox.h
Go to the documentation of this file.
1 //
2 // ShoeBox.h
3 // ShoeBox
4 //
5 // Created by Jorge Castellanos & Will Wolcott on 4/29/05.
6 // Copyright 2005 Jorge Castellanos & Will Wolcott. All rights reserved.
7 //
8 
9 
10 #ifndef SHOEBOX_H
11 #define SHOEBOX_H
12 
13 #include "CPoint.h"
14 
15 namespace csl {
16 
17 enum {
18  kMarble = 0,
23 };
24 
25 // This class calculates the reflection time and amplitude of a sound
26 // assuming the space is rectangulsr, in other words, a shoe box.
27 
28 class ShoeBox {
29 public:
30  // Defaults to a listener positioned at the center of the room.
31  ShoeBox();
32  ~ShoeBox();
33 
34  void setSourceLocation(float x, float y, float z);
35  void setListenerLocation(float x, float y, float z);
36  void setRoomSize(float x, float y, float z);
37  CPoint roomSize() { return mRoomSize; };
38  CPoint source() { return mSource; };
40  void setWallMaterialsDamp(int dampX, int dampY, int dampZ);
41  void setDuration(int ms);
42  void getReflections(float *ref, float *gains, float *angles, int num);
43  void calculateReflections();
45 
46 private:
47 
51  int mDuration, mNumReflections, mMaxBouncesX, mMaxBouncesY, mMaxBouncesZ; // The miliseconds that will be calculated reflections.
52 
53  void shellSort();
54  bool checkPositionValues();
55 
56 };
57 
58 
59 }
60 
61 #endif