Alvaro Cassinelli
/
skinGames_forktest
just a test
Fork of scoreLight_Advanced by
Diff: rigidLoop.h
- Revision:
- 31:5f039cbddee8
- Parent:
- 30:d8af03f01cd4
- Child:
- 32:52273c3291fe
diff -r d8af03f01cd4 -r 5f039cbddee8 rigidLoop.h --- a/rigidLoop.h Fri Sep 21 10:02:35 2012 +0000 +++ b/rigidLoop.h Sun Sep 23 10:11:43 2012 +0000 @@ -8,7 +8,9 @@ using namespace std; -enum RigidLoopMode {SPOT_FOLLOWING, SPOT_TRACK, SPOT_GHOST, SPOT_PACMAN, SPOT_BOUNCING, SPOT_AIR_HOCKEY, SPOT_LORENTZ_FORCE, SPOT_TEST}; +enum RigidLoopMode {SPOT_FOLLOWING, SPOT_GHOST, SPOT_PACMAN, SPOT_BOUNCING, SPOT_AIR_HOCKEY, SPOT_LORENTZ_FORCE, + SPOT_TEST, SPOT_TRACK, SPOT_TRACK_DOT, + EXPLOSION}; class rigidLoop : public soundSpot { @@ -21,12 +23,18 @@ // instantiation of the virtual methods of the base class (we don't need to append "virtual", but for clarity I do): void createBlob(int _id, RigidLoopMode _rigidBlobMode, vector2Df _initPos, vector2Df _initSpeed); virtual void setRegionMotion(float mmix, float mmiy, float mmax, float mmay); // attention: initial position posX and posY should be inside this bounding box... - virtual void update(); // update dynamics of the mass loop + virtual void update(vector2Df referencePos); // update dynamics of the mass loop virtual void draw(void); // draw the blob (renders on the laser trajectory object lsdTrajectory from the base class, using the openGL laser renderer - not yet done). virtual void computeBoundingBox(); virtual void sendDataSpecific(void); virtual void speedFactor(float speedfactor); - + + virtual void explosion(); // not very nice programming style, it should be a MODE instead or something like that. + virtual vector2Df getCenter(); + virtual void resetPositionSpeed() {centerMass.setInitialCondition(startCenter, startSpeed);}; + virtual void setPositionSpeed(vector2Df _pos, vector2Df _spe) {centerMass.setInitialCondition(_pos, _spe);}; + + // methods that are new to this class (not in base class): void initSizeBlob(int _numPoints); void createLoopFromScafold(void); // this is much simpler than the elastic blob (here, we only need to add a central mass)