add time-based spacing and variable scroll speed (commented out because it wasn't as helpful as I hoped)

This commit is contained in:
Chris Danford
2003-04-16 22:49:40 +00:00
parent 3c6ed5a9ed
commit 25ef2863e0
11 changed files with 162 additions and 75 deletions
+13
View File
@@ -29,6 +29,19 @@
unsigned long randseed = time(NULL);
void fapproach( float& val, float other_val, float to_move )
{
ASSERT( to_move >= 0 );
if( val == other_val )
return;
float fDelta = other_val - val;
float fSign = fDelta / fabsf( fDelta );
float fToMove = fSign*to_move;
if( fabsf(fToMove) > fabsf(fDelta) )
fToMove = fDelta; // snap
val += fToMove;
}
/* Return a positive x mod y. */
float fmodfp(float x, float y)
{