From 92eddb0fd404624ca198f19e4088927701eec7f5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 9 Jan 2005 17:37:50 +0000 Subject: better animate rate (Marcelo Magallon) --- progs/demos/pointblast.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'progs/demos/pointblast.c') diff --git a/progs/demos/pointblast.c b/progs/demos/pointblast.c index 14e9cf359f..715813f176 100644 --- a/progs/demos/pointblast.c +++ b/progs/demos/pointblast.c @@ -79,7 +79,6 @@ static float float_rand(void) { return rand() / (float) RAND_MAX; } #define MEAN_VELOCITY 3.0 #define GRAVITY 2.0 -#define TIME_DELTA 0.025 /* The speed of time. */ /* Modeling units of ground extent in each X and Z direction. */ #define EDGE 12 @@ -114,6 +113,13 @@ updatePointList(void) float distance; int i; + static double t0 = -1.; + double dt, t = glutGet(GLUT_ELAPSED_TIME) / 1000.0; + if (t0 < 0.0) + t0 = t; + dt = t - t0; + t0 = t; + motion = 0; for (i=0; i