ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/util.C
(Generate patch)

Comparing libgender/util.C (file contents):
Revision 1.5 by root, Mon Oct 4 02:06:57 2004 UTC vs.
Revision 1.6 by root, Mon Oct 4 07:04:58 2004 UTC

10#include <time.h> 10#include <time.h>
11 11
12#include "util.h" 12#include "util.h"
13 13
14#define DEG2RAD (M_PI / 180.) 14#define DEG2RAD (M_PI / 180.)
15
16void renormalize (sector &s, point &p)
17{
18 float i;
19
20 p.x = modff (p.x, &i); s.x += (int)i;
21 p.y = modff (p.y, &i); s.y += (int)i;
22 p.z = modff (p.z, &i); s.z += (int)i;
23}
15 24
16const vec3 normalize (const vec3 &v) 25const vec3 normalize (const vec3 &v)
17{ 26{
18 GLfloat s = abs (v); 27 GLfloat s = abs (v);
19 28
213void box::add (const point &p) 222void box::add (const point &p)
214{ 223{
215 a.x = min (a.x, (soffs)floorf (p.x)); 224 a.x = min (a.x, (soffs)floorf (p.x));
216 a.y = min (a.y, (soffs)floorf (p.y)); 225 a.y = min (a.y, (soffs)floorf (p.y));
217 a.z = min (a.z, (soffs)floorf (p.z)); 226 a.z = min (a.z, (soffs)floorf (p.z));
218 b.x = max (b.x, (soffs)ceilf (p.x)); 227 b.x = max (b.x, (soffs)ceilf (p.x));
219 b.y = max (b.y, (soffs)ceilf (p.y)); 228 b.y = max (b.y, (soffs)ceilf (p.y));
220 b.z = max (b.z, (soffs)ceilf (p.z)); 229 b.z = max (b.z, (soffs)ceilf (p.z));
221} 230}
222 231
223struct timer timer; 232struct timer timer;
224static double base; 233static double base;
225double timer::now = 0.; 234double timer::now = 0.;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines