Alvaro Cassinelli / Mbed 2 deprecated skinGames_forktest

Dependencies:   mbed

Fork of scoreLight_Advanced by Alvaro Cassinelli

Committer:
mbedalvaro
Date:
Mon Jun 18 11:37:00 2012 +0000
Revision:
25:74cb85b85fd2
Parent:
19:228430f1350e
Child:
27:1ce994629ffc
corrected some mistakes on color control;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbedalvaro 0:345b3bc7a0ea 1 #ifndef blobConf_h
mbedalvaro 0:345b3bc7a0ea 2 #define blobConf_h
mbedalvaro 0:345b3bc7a0ea 3
mbedalvaro 0:345b3bc7a0ea 4 // include all kind of spots classes (childs of soundSpot)
mbedalvaro 15:56a0bf424e8d 5 #include "elasticLoop.h"
mbedalvaro 1:a4050fee11f7 6 #include "rigidLoop.h"
mbedalvaro 0:345b3bc7a0ea 7
mbedalvaro 11:62f7183a03e7 8 #include <vector>
mbedalvaro 15:56a0bf424e8d 9 //#include <deque>; // using a deque instead of a vector can have advantanges in terms of memory (deque can handle fragmented memory), BUT IS SLOWER.
mbedalvaro 15:56a0bf424e8d 10 using namespace std;
mbedalvaro 11:62f7183a03e7 11
mbedalvaro 0:345b3bc7a0ea 12 class blobConfig {
mbedalvaro 15:56a0bf424e8d 13 public:
mbedalvaro 15:56a0bf424e8d 14
mbedalvaro 15:56a0bf424e8d 15 //========== Methods =============
mbedalvaro 15:56a0bf424e8d 16 blobConfig(); // overaloded constructor
mbedalvaro 15:56a0bf424e8d 17 ~blobConfig();
mbedalvaro 15:56a0bf424e8d 18
mbedalvaro 15:56a0bf424e8d 19 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()).
mbedalvaro 15:56a0bf424e8d 20
mbedalvaro 15:56a0bf424e8d 21 void allKill(); // this put all the blobs in "dead" mode, meaning that neither rendering nor update is done (but they are not deleted).
mbedalvaro 15:56a0bf424e8d 22 void allAlive();
mbedalvaro 15:56a0bf424e8d 23
mbedalvaro 15:56a0bf424e8d 24 void allStandBy(); //NO update, but rendering may be done (they are "frozen" in their positions)
mbedalvaro 15:56a0bf424e8d 25 void allResume();
mbedalvaro 15:56a0bf424e8d 26
mbedalvaro 15:56a0bf424e8d 27 void allInvisible(); // blobs are invisible, but they may continue to evolve (call to update)
mbedalvaro 15:56a0bf424e8d 28 void allVisible();
mbedalvaro 25:74cb85b85fd2 29
mbedalvaro 25:74cb85b85fd2 30 void allSetColor(unsigned char c);
mbedalvaro 25:74cb85b85fd2 31
mbedalvaro 15:56a0bf424e8d 32 void update(); // update dynamics
mbedalvaro 15:56a0bf424e8d 33 void draw(); // draw in the LaserSensingTrajectory object (lsdTrajectory) of each blob, using the openGL laser rendering (not yet done).
mbedalvaro 15:56a0bf424e8d 34
mbedalvaro 15:56a0bf424e8d 35 void sendConfData(); // send OSC data for all the blobs
mbedalvaro 15:56a0bf424e8d 36
mbedalvaro 15:56a0bf424e8d 37 // ========= Standard configurations: =====================
mbedalvaro 15:56a0bf424e8d 38 void computeBoundingBox();
mbedalvaro 15:56a0bf424e8d 39
mbedalvaro 15:56a0bf424e8d 40 void addOneElasticLoopRelax();
mbedalvaro 15:56a0bf424e8d 41 void addOneElasticLoopContract();
mbedalvaro 15:56a0bf424e8d 42 void addOneElasticLoopContractCentral();
mbedalvaro 19:228430f1350e 43 void addOneElasticLoopContractCentralFast();
mbedalvaro 15:56a0bf424e8d 44 void addOneElasticContourFollowing();
mbedalvaro 15:56a0bf424e8d 45 void addOneElasticContourFollowingFAST();
mbedalvaro 15:56a0bf424e8d 46 void addOneElasticBouncing();
mbedalvaro 15:56a0bf424e8d 47
mbedalvaro 15:56a0bf424e8d 48 void addOneRigidLoopBouncing();
mbedalvaro 15:56a0bf424e8d 49 void addOneRigidLoopFollowing();
mbedalvaro 15:56a0bf424e8d 50 void addOneRigidLoopTest();
mbedalvaro 15:56a0bf424e8d 51
mbedalvaro 15:56a0bf424e8d 52 //========== Variables =============
mbedalvaro 15:56a0bf424e8d 53 // 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)
mbedalvaro 15:56a0bf424e8d 54 // BUT ATTENTION when clearing the vector: instantiated objects must be DELETED before.
mbedalvaro 15:56a0bf424e8d 55 vector<soundSpot*> blobArray;
mbedalvaro 15:56a0bf424e8d 56 int numBlobs;// this is just equal to blobArray.size()
mbedalvaro 0:345b3bc7a0ea 57 };
mbedalvaro 0:345b3bc7a0ea 58
mbedalvaro 0:345b3bc7a0ea 59
mbedalvaro 0:345b3bc7a0ea 60 #endif