just a test

Dependencies:   mbed

Fork of scoreLight_Advanced by Alvaro Cassinelli

Revision:
5:73cd58b58f95
Parent:
4:f9d364f10335
Child:
12:0de9cd2bced5
--- a/classPointMass.cpp	Wed Apr 04 10:05:25 2012 +0000
+++ b/classPointMass.cpp	Thu Apr 05 12:29:14 2012 +0000
@@ -238,6 +238,12 @@
         
 #endif
 
+    // Constrain speed to max speed (in norm):
+    float normSpeed=getSpeed().length();
+    if (normSpeed>100) {
+        setSpeed(getSpeed()*100.0/normSpeed);
+    }
+
     }
 }