00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef SHOEBOX_H
00011 #define SHOEBOX_H
00012
00013 #include "CPoint.h"
00014
00015 namespace csl {
00016
00017 enum {
00018 kMarble = 0,
00019 kConcrete,
00020 kBrick,
00021 kGlass,
00022 kWood
00023 };
00024
00025
00026
00027
00028 class ShoeBox {
00029 public:
00030
00031 ShoeBox();
00032 ~ShoeBox();
00033
00034 void setSourceLocation(float x, float y, float z);
00035 void setListenerLocation(float x, float y, float z);
00036 void setRoomSize(float x, float y, float z);
00037 CPoint roomSize() { return mRoomSize; };
00038 CPoint source() { return mSource; };
00039 CPoint listener() { return mListenerPosition; };
00040 void setWallMaterialsDamp(int dampX, int dampY, int dampZ);
00041 void setDuration(int ms);
00042 void getReflections(float *ref, float *gains, float *angles, int num);
00043 void calculateReflections();
00044 void findNumReflectionsFromTime();
00045
00046 private:
00047
00048 CPoint mRoomSize, mSource, mListenerPosition;
00049 float mDampX, mDampY,mDampZ;
00050 float *mReflectionsArray, *mGainsArray, *mAnglesArray;
00051 int mDuration, mNumReflections, mMaxBouncesX, mMaxBouncesY, mMaxBouncesZ;
00052
00053 void shellSort();
00054 bool checkPositionValues();
00055
00056 };
00057
00058
00059 }
00060
00061 #endif