8 |
|
*/ |
9 |
|
|
10 |
|
#include "standard.h" |
11 |
– |
|
11 |
|
#include "octree.h" |
13 |
– |
|
12 |
|
#include "object.h" |
15 |
– |
|
13 |
|
#include "cone.h" |
14 |
|
|
15 |
|
#define ROOT3 1.732050808 |
29 |
|
|
30 |
|
extern double mincusize; /* minimum cube size */ |
31 |
|
|
32 |
+ |
static double findcseg(FVECT ep0, FVECT ep1, CONE *co, FVECT p); |
33 |
|
|
34 |
< |
o_cone(o, cu) /* determine if cone intersects cube */ |
35 |
< |
OBJREC *o; |
36 |
< |
register CUBE *cu; |
34 |
> |
|
35 |
> |
|
36 |
> |
/* XXX o_cone() is extern, but not declared in any header file */ |
37 |
> |
int |
38 |
> |
o_cone( /* determine if cone intersects cube */ |
39 |
> |
OBJREC *o, |
40 |
> |
register CUBE *cu |
41 |
> |
) |
42 |
|
{ |
40 |
– |
double dist2lseg(), findcseg(); |
43 |
|
CONE *co; |
44 |
|
FVECT ep0, ep1; |
45 |
+ |
#ifdef STRICT |
46 |
|
FVECT cumin, cumax; |
47 |
|
CUBE cukid; |
48 |
+ |
register int j; |
49 |
+ |
#endif |
50 |
|
double r; |
51 |
|
FVECT p; |
52 |
< |
register int i, j; |
52 |
> |
register int i; |
53 |
|
/* get cone arguments */ |
54 |
|
co = getcone(o, 0); |
55 |
|
/* get cube center */ |
93 |
|
} |
94 |
|
|
95 |
|
|
96 |
< |
double |
97 |
< |
findcseg(ep0, ep1, co, p) /* find line segment from cone closest to p */ |
98 |
< |
FVECT ep0, ep1; |
99 |
< |
register CONE *co; |
100 |
< |
FVECT p; |
96 |
> |
static double |
97 |
> |
findcseg( /* find line segment from cone closest to p */ |
98 |
> |
FVECT ep0, |
99 |
> |
FVECT ep1, |
100 |
> |
register CONE *co, |
101 |
> |
FVECT p |
102 |
> |
) |
103 |
|
{ |
104 |
|
double d; |
105 |
|
FVECT v; |