Alvaro Cassinelli
/
skinGames_forktest
just a test
Fork of scoreLight_Advanced by
blobConfig.h
- Committer:
- mbedalvaro
- Date:
- 2012-06-18
- Revision:
- 27:1ce994629ffc
- Parent:
- 25:74cb85b85fd2
- Child:
- 28:44b7b6e35548
File content as of revision 27:1ce994629ffc:
#ifndef blobConf_h #define blobConf_h // include all kind of spots classes (childs of soundSpot) #include "elasticLoop.h" #include "rigidLoop.h" #include <vector> //#include <deque>; // using a deque instead of a vector can have advantanges in terms of memory (deque can handle fragmented memory), BUT IS SLOWER. using namespace std; class blobConfig { public: //========== Methods ============= blobConfig(); // overaloded constructor ~blobConfig(); void clearConfig(); // actually delete every element of the config (note: the blobArray is a vector of POINTERS, it is not enought to do blobArray.clear()). void allKill(); // this put all the blobs in "dead" mode, meaning that neither rendering nor update is done (but they are not deleted). void allAlive(); void allStandBy(); //NO update, but rendering may be done (they are "frozen" in their positions) void allResume(); void allInvisible(); // blobs are invisible, but they may continue to evolve (call to update) void allVisible(); void allSetColor(unsigned char c); void update(); // update dynamics void draw(); // draw in the LaserSensingTrajectory object (lsdTrajectory) of each blob, using the openGL laser rendering (not yet done). void sendConfData(); // send OSC data for all the blobs // ========= Standard configurations: ===================== void computeBoundingBox(); void addOneElasticLoopRelax(); void addOneElasticLoopContract(); void addOneElasticLoopContractCentral(); void addOneElasticLoopContractCentralFast(); void addOneElasticContourFollowing(); void addOneElasticContourFollowingFAST(); void addOneElasticBouncing(); void addOneRigidLoopBouncing(); void addOneRigidLoopFountain(); void addOneRigidLoopFollowing(); void addOneRigidLoopTest(); //========== Variables ============= // I use an array (actually a vector) of POINTERS of polymorphic class soundSpot with virtual methods (this way we can access polymorphic methods - of children - with a pointer) // BUT ATTENTION when clearing the vector: instantiated objects must be DELETED before. vector<soundSpot*> blobArray; int numBlobs;// this is just equal to blobArray.size() }; #endif