just a test

Dependencies:   mbed

Fork of scoreLight_Advanced by Alvaro Cassinelli

Committer:
mbedalvaro
Date:
Sat Mar 31 08:19:31 2012 +0000
Revision:
1:a4050fee11f7
Parent:
0:345b3bc7a0ea
Child:
5:73cd58b58f95
new scorelight methods added. VERY STRANGE problem with oldPos and pos in Verlet method, that have strange behaviour depending on the value of damp factor...

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 0:345b3bc7a0ea 5 #include "elasticLoop.h"
mbedalvaro 1:a4050fee11f7 6 #include "rigidLoop.h"
mbedalvaro 0:345b3bc7a0ea 7
mbedalvaro 0:345b3bc7a0ea 8 class blobConfig {
mbedalvaro 0:345b3bc7a0ea 9 public:
mbedalvaro 0:345b3bc7a0ea 10
mbedalvaro 0:345b3bc7a0ea 11 //========== Methods =============
mbedalvaro 0:345b3bc7a0ea 12 blobConfig(); // overaloded constructor
mbedalvaro 0:345b3bc7a0ea 13 ~blobConfig();
mbedalvaro 0:345b3bc7a0ea 14
mbedalvaro 0:345b3bc7a0ea 15 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 0:345b3bc7a0ea 16
mbedalvaro 0:345b3bc7a0ea 17 void allKill(); // this put all the blobs in "dead" mode, meaning that neither rendering nor update is done (but they are not deleted).
mbedalvaro 0:345b3bc7a0ea 18 void allAlive();
mbedalvaro 0:345b3bc7a0ea 19
mbedalvaro 0:345b3bc7a0ea 20 void allStandBy(); //NO update, but rendering may be done (they are "frozen" in their positions)
mbedalvaro 0:345b3bc7a0ea 21 void allResume();
mbedalvaro 0:345b3bc7a0ea 22
mbedalvaro 0:345b3bc7a0ea 23 void allInvisible(); // blobs are invisible, but they may continue to evolve (call to update)
mbedalvaro 0:345b3bc7a0ea 24 void allVisible();
mbedalvaro 0:345b3bc7a0ea 25
mbedalvaro 0:345b3bc7a0ea 26 void update(); // update dynamics
mbedalvaro 0:345b3bc7a0ea 27 void draw(); // draw in the LaserSensingTrajectory object (lsdTrajectory) of each blob, using the openGL laser rendering (not yet done).
mbedalvaro 0:345b3bc7a0ea 28
mbedalvaro 0:345b3bc7a0ea 29 void sendConfData(); // send OSC data for all the blobs
mbedalvaro 0:345b3bc7a0ea 30
mbedalvaro 0:345b3bc7a0ea 31 // ========= Standard configurations: =====================
mbedalvaro 0:345b3bc7a0ea 32 void computeBoundingBox();
mbedalvaro 0:345b3bc7a0ea 33
mbedalvaro 0:345b3bc7a0ea 34 void addOneElasticLoopRelax();
mbedalvaro 0:345b3bc7a0ea 35 void addOneElasticLoopContract();
mbedalvaro 0:345b3bc7a0ea 36 void addOneElasticLoopContractCentral();
mbedalvaro 0:345b3bc7a0ea 37 void addOneElasticContourFollowing();
mbedalvaro 0:345b3bc7a0ea 38 void addOneElasticContourFollowingFAST();
mbedalvaro 0:345b3bc7a0ea 39 void addOneElasticBouncing();
mbedalvaro 0:345b3bc7a0ea 40
mbedalvaro 1:a4050fee11f7 41 void addOneRigidLoopBouncing();
mbedalvaro 1:a4050fee11f7 42 void addOneRigidLoopFollowing();
mbedalvaro 1:a4050fee11f7 43
mbedalvaro 0:345b3bc7a0ea 44 //========== Variables =============
mbedalvaro 0:345b3bc7a0ea 45 // 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 0:345b3bc7a0ea 46 // BUT ATTENTION when clearing the vector: instantiated objects must be DELETED before.
mbedalvaro 0:345b3bc7a0ea 47 vector<soundSpot*> blobArray;
mbedalvaro 0:345b3bc7a0ea 48 int numBlobs;// this is just equal to blobArray.size()
mbedalvaro 0:345b3bc7a0ea 49 };
mbedalvaro 0:345b3bc7a0ea 50
mbedalvaro 0:345b3bc7a0ea 51
mbedalvaro 0:345b3bc7a0ea 52 #endif