Alvaro Cassinelli
/
skinGames_forktest
just a test
Fork of scoreLight_Advanced by
Diff: rigidLoop.cpp
- Revision:
- 33:43e8bc451ef0
- Parent:
- 32:52273c3291fe
- Child:
- 34:1244fa3f2559
diff -r 52273c3291fe -r 43e8bc451ef0 rigidLoop.cpp --- a/rigidLoop.cpp Mon Oct 29 14:28:47 2012 +0000 +++ b/rigidLoop.cpp Mon Nov 05 06:08:35 2012 +0000 @@ -384,6 +384,28 @@ pointMass::setWallLimits(mmix+10, mmiy+10, mmax-10, mmay-10); } +void rigidLoop::setSize(float _newSize) { + saccadeRadius=_newSize; + saccadeRadius_initial=_newSize; + // rebuild the blueprint (that's all it's needed in the case of a rigid loop, IF we don't change the number of points in the scafold of course): + bluePrint.resizeDimensionScafold(_newSize); +} +void rigidLoop::sizeFactor(float sizeFactor) { + saccadeRadius*=sizeFactor; + saccadeRadius_initial*=sizeFactor; + // rebuild the blueprint (that's all it's needed in the case of a rigid loop, IF we don't change the number of points in the scafold of course): + bluePrint.resizeFactorDimensionScafold(sizeFactor); +} + +void rigidLoop::setSpeed(float _newspeed) { +// in case of spot following: + speedContourFollowing=_newspeed; + + // in case of bouncing, there are many ways to change the speed (play with the mass, damping or the bouncing force). + //centerMass.mass/=speedfactor;//0.0008;//+0.000005*(rand()%100); + centerMass.dampMotion/=1.0*_newspeed/7;//0.00045;//0.00015;//00003; + //factorBouncingForce=0.0018; // this is because we will use a force on the central mass + } void rigidLoop::speedFactor(float speedfactor) { // in case of spot following: @@ -393,18 +415,8 @@ //centerMass.mass/=speedfactor;//0.0008;//+0.000005*(rand()%100); centerMass.dampMotion/=speedfactor;//0.00045;//0.00015;//00003; //factorBouncingForce=0.0018; // this is because we will use a force on the central mass - - } -void rigidLoop::sizeFactor(float sizeFactor) { - saccadeRadius*=sizeFactor; - saccadeRadius_initial*=sizeFactor; - // rebuild the blueprint (that's all it's needed in the case of a rigid loop, IF we don't change the number of points in the scafold of course): - bluePrint.resizeDimensionScafold(sizeFactor); -} - - void rigidLoop::explosion() { transientBlobColor=blobColor|0x02;