Alvaro Cassinelli
/
skinGames_forktest
just a test
Fork of scoreLight_Advanced by
Diff: classPointMass.cpp
- Revision:
- 5:73cd58b58f95
- Parent:
- 4:f9d364f10335
- Child:
- 12:0de9cd2bced5
diff -r f9d364f10335 -r 73cd58b58f95 classPointMass.cpp --- 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); + } + } }