Mercurial > hg > wabletios
comparison scanpath.h @ 3:d346ddc50f70
Vectorised a few things. Fiddled with new mesh creator... not solved much.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Fri, 07 Dec 2012 19:20:57 +0000 |
parents | c667dfe12d47 |
children | 5b659bc0b572 |
comparison
equal
deleted
inserted
replaced
2:0aab7a1d3c77 | 3:d346ddc50f70 |
---|---|
10 #ifndef _SCANPATHH | 10 #ifndef _SCANPATHH |
11 #define _SCANPATHH | 11 #define _SCANPATHH |
12 #include "lump.h" | 12 #include "lump.h" |
13 #include "spring.h" | 13 #include "spring.h" |
14 #include <vector> | 14 #include <vector> |
15 | 15 struct Element{ |
16 Lump * eLump; | |
17 Spring * eSpring; | |
18 Element(Lump * aLump, Spring * aSpring){ | |
19 eLump = aLump; | |
20 eSpring = aSpring; | |
21 | |
22 }; | |
23 | |
24 }; | |
16 | 25 |
17 class ScanPath{ | 26 class ScanPath{ |
18 private: | 27 private: |
19 int numElements; | 28 int numElements; |
20 int maxElements; | 29 int maxElements; |
22 bool audioAccessing; | 31 bool audioAccessing; |
23 bool updateAccessing; | 32 bool updateAccessing; |
24 | 33 |
25 //Spring ** springPath; | 34 //Spring ** springPath; |
26 // springpath - an array of pointers to the springs in the path | 35 // springpath - an array of pointers to the springs in the path |
27 // lump path - ditto should be same number | 36 // lump path - ditto should be same number |
28 Lump ** lumpPath; | 37 vector<Element> pathElements; |
29 Spring ** springPath; | 38 |
30 | |
31 double * wavetableNew; | 39 double * wavetableNew; |
32 double * wavetableOld; | 40 double * wavetableOld; |
33 double * wavetableUpdate; | 41 double * wavetableUpdate; |
34 | 42 |
35 double currentLength; | 43 double currentLength; |
46 scanModes scanMode; | 54 scanModes scanMode; |
47 double restLength; | 55 double restLength; |
48 | 56 |
49 ScanPath(); | 57 ScanPath(); |
50 ~ScanPath(); | 58 ~ScanPath(); |
51 | 59 void init(); |
52 | 60 |
53 void inscribe(double ax,double ay); | 61 void inscribe(double ax,double ay); |
54 void clear(); | 62 void clear(); |
55 | 63 |
56 void draw(); | 64 void draw(); |
65 double getNextSample(); | 73 double getNextSample(); |
66 double getNextSample(double aPhasor); | 74 double getNextSample(double aPhasor); |
67 double getNextSampleCubic(double aPhasor); | 75 double getNextSampleCubic(double aPhasor); |
68 // redone stuff | 76 // redone stuff |
69 void initWavetables(); | 77 void initWavetables(); |
70 void addElement(Lump* aLump, Spring * aSpring); | 78 void addElement(Lump* const aLump, Spring * const aSpring); |
71 | 79 |
72 void updateWavetables(); | 80 void updateWavetables(); |
73 | 81 |
74 }; | 82 }; |
75 | 83 |