Mercurial > hg > wabletios
view scanpath.h @ 6:5b659bc0b572
line mesh for supernatant
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Mon, 04 Feb 2013 19:26:08 +0000 |
parents | d346ddc50f70 |
children | 4ea605899aca |
line wrap: on
line source
/* * scanpath.h * springstructure * * Created by Robert Tubb on 09/06/2011. * Copyright 2011 __MyCompanyName__. All rights reserved. * */ #ifndef _SCANPATHH #define _SCANPATHH #include "lump.h" #include "spring.h" #include <vector> struct Element{ Lump * eLump; Spring * eSpring; Element(Lump * aLump, Spring * aSpring){ eLump = aLump; eSpring = aSpring; }; }; class ScanPath{ private: int numElements; int maxElements; bool audioAccessing; bool updateAccessing; bool bidirectional; //Spring ** springPath; // springpath - an array of pointers to the springs in the path // lump path - ditto should be same number vector<Element> pathElements; double * wavetableNew; double * wavetableOld; double * wavetableUpdate; double currentLength; double frameInterpolator; double framesPerSample; public: enum scanModes {DISPLACEMENT,SPEED,SPRING_FORCE,YPOS}; scanModes scanMode; double restLength; ScanPath(); ~ScanPath(); void init(); void inscribe(double ax,double ay); void clear(); void draw(); void drawCubic(); double getTotalLength(); int howManyElements(); void addSpring(); void addLump(); double getNextSample(); double getNextSample(double aPhasor); double getNextSampleCubic(double aPhasor); // redone stuff void initWavetables(); void addElement(Lump* const aLump, Spring * const aSpring); void updateWavetables(); }; #endif