From: Keith F. <ven...@us...> - 2003-01-12 09:26:44
|
Update of /cvsroot/planeshift/planeshift/src/common/psprop/imp In directory sc8-pr-cvs1:/tmp/cvs-serv739 Modified Files: pslinmove.cpp Log Message: Reworked intervals of DR sending, so it is more efficient when going up hills but still responsive when starting and stopping. Index: pslinmove.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/psprop/imp/pslinmove.cpp,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** pslinmove.cpp 11 Jan 2003 09:46:15 -0000 1.56 --- pslinmove.cpp 12 Jan 2003 09:26:41 -0000 1.57 *************** *** 835,849 **** // Send a minimum of every 2 seconds no matter what ! if (delta>2000) { lastSentRotation = angularVelocity; lastSentVelocity = vel; ! printf("DR:2 second max rule\n"); return true; } // has the velocity rotation changed since last DR msg sent? ! if (angularVelocity != lastSentRotation || ! vel != lastSentVelocity) { lastSentRotation = angularVelocity; --- 835,852 ---- // Send a minimum of every 2 seconds no matter what ! if (delta>3000) { lastSentRotation = angularVelocity; lastSentVelocity = vel; ! printf("DR:3 second max rule\n"); return true; } // has the velocity rotation changed since last DR msg sent? ! if ((angularVelocity != lastSentRotation || ! vel != lastSentVelocity) && ((delta>100) || angularVelocity.IsZero() || ! lastSentRotation.IsZero() || ! vel.IsZero() || ! lastSentVelocity.IsZero())) { lastSentRotation = angularVelocity; *************** *** 855,863 **** // if in motion, send every half second instead of every 2 secs. if ((!lastSentVelocity.IsZero() || !lastSentRotation.IsZero() ) && ! (delta > 500)) { lastSentRotation = angularVelocity; lastSentVelocity = vel; ! printf("DR:1/2 second in motion rule\n"); return true; } --- 858,866 ---- // if in motion, send every half second instead of every 2 secs. if ((!lastSentVelocity.IsZero() || !lastSentRotation.IsZero() ) && ! (delta > 1000)) { lastSentRotation = angularVelocity; lastSentVelocity = vel; ! printf("DR:1 second in motion rule\n"); return true; } |