just a test

Dependencies:   mbed

Fork of scoreLight_Advanced by Alvaro Cassinelli

Revision:
25:74cb85b85fd2
Parent:
24:4e52031a495b
Child:
26:c9329c4fc20a
--- a/rigidLoop.cpp	Mon Jun 18 08:00:57 2012 +0000
+++ b/rigidLoop.cpp	Mon Jun 18 11:37:00 2012 +0000
@@ -309,7 +309,7 @@
             centerMass.addForce(dist.normalize()*centerMass.mass*0.5);
           
 
-            // update dynamics for the central mass::
+            // update dynamics for the central mass:
 #ifndef VERLET_METHOD
             centerMass.addDampingForce();  // // only in case of EULER method (damping in VERLET mode is done automatically when updating)
 #endif
@@ -324,15 +324,6 @@
              
             break;
     }
-
-    // OTHER PARTICULAR THINGS:
-    if (displaySensingBuffer.lightTouched)  {
-          // setGreenPower(1); // setColor(0x02); // green on
-           setColor(0x02|blobColor); // set green ON, regardless of the initial color
-    } else {
-          // setGreenPower(0); //setColor(0x00); // green off
-           setColor(blobColor); // set green OFF (IF it was off from the start)
-     }
     
     
     // change sliding direction (for countour following):
@@ -359,10 +350,14 @@
         // We can also do this, but ATTENTION: centerMass.pos is a vector2Df, and scafold[i] is a vector2Dd (typecasting?)
         // displaySensingBuffer.lsdTrajectory[i]= bluePrint.scafold[i] + centerMass.pos;
         
-        displaySensingBuffer.displayColor=blobColor; // perhaps per point color is not a good idea for the time being...
+        //displaySensingBuffer.displayColor=blobColor; // perhaps per point color is not a good idea for the time being...
     }
-    // global color for the whole loop:
-    displaySensingBuffer.displayColor=blobColor;
+    
+    // Global color for the whole loop:
+    if (displaySensingBuffer.lightTouched)  
+        displaySensingBuffer.displayColor=blobColor|0x02; // set green ON on the trajectory, regardless of the initial color
+     else 
+         displaySensingBuffer.displayColor=blobColor;
 }
 
 void rigidLoop::computeBoundingBox() {