Mercurial > hg > opencollidoscope
changeset 7:a4a336624f5a
added some comments
DrawInfo dependency from NUM_WAVES
author | Fiore Martin <f.martin@qmul.ac.uk> |
---|---|
date | Fri, 15 Jul 2016 16:05:34 +0200 |
parents | 4c0e82b725d9 |
children | 4c738d26de4f |
files | CollidoscopeApp/include/DrawInfo.h CollidoscopeApp/include/Oscilloscope.h CollidoscopeApp/include/Wave.h |
diffstat | 3 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/CollidoscopeApp/include/DrawInfo.h Thu Jul 14 15:08:31 2016 +0200 +++ b/CollidoscopeApp/include/DrawInfo.h Fri Jul 15 16:05:34 2016 +0200 @@ -93,7 +93,7 @@ int32_t getWaveCenterY() const { if ( mWaveIndex == 0 ) - return mWindowHeight * 0.75f + 1; + return mWindowHeight - ( mWindowHeight / ( 2 * NUM_WAVES ) ) + 1; else return mWindowHeight / (NUM_WAVES * 2); }
--- a/CollidoscopeApp/include/Oscilloscope.h Thu Jul 14 15:08:31 2016 +0200 +++ b/CollidoscopeApp/include/Oscilloscope.h Fri Jul 15 16:05:34 2016 +0200 @@ -57,11 +57,12 @@ } audioVal *= 0.8f; - // this yRatio is for the bottom scope, the top will be drawn with a translation/4 - // because it's half of the half of the tier where the wave is drawn + // map audio val from [-1.0, 1.0] to [0.0, 1.0] + // then map the value obtained to the height of the wave tier ( window height / NUM_WAVES ) float yRatio = ((1 + audioVal) / 2.0f) * (di.getWindowHeight() / NUM_WAVES ); float xRatio = index * (di.getWindowWidth() / (float)mLine.size()); + // this flips the coordinates for the second wave mLine.getPoints()[index].x = float( di.flipX( int(xRatio) ) ); mLine.getPoints()[index].y = float( di.flipY( int(yRatio) ) );
--- a/CollidoscopeApp/include/Wave.h Thu Jul 14 15:08:31 2016 +0200 +++ b/CollidoscopeApp/include/Wave.h Fri Jul 15 16:05:34 2016 +0200 @@ -87,7 +87,10 @@ /** Sets the size of selection. size is the number of chunks the selection is made of */ void setSize( size_t size ); - /** Particle spread is used to calculate the size of the cloud of particles */ + /** The particle spread parameter affects the size of the cloud of particles + * The cloud is the visual conterpart of the grain duration coefficien in sound. + * Indeed spread accepts values from 1 to 8, exactly as the duration coefficient + */ void inline setParticleSpread( float spread ){ mParticleSpread = spread; }