37 |
|
|
38 |
|
FVECT meshbounds[2]; /* mesh bounding box */ |
39 |
|
|
40 |
+ |
static void add2bounds(FVECT vp, RREAL vc[2]); |
41 |
+ |
static OBJECT cvmeshtri(OBJECT obj); |
42 |
+ |
static OCTREE cvmeshoct(OCTREE ot); |
43 |
|
|
44 |
+ |
|
45 |
+ |
|
46 |
|
MESH * |
47 |
< |
cvinit(nm) /* initialize empty mesh */ |
48 |
< |
char *nm; |
47 |
> |
cvinit( /* initialize empty mesh */ |
48 |
> |
char *nm |
49 |
> |
) |
50 |
|
{ |
51 |
|
/* free old mesh, first */ |
52 |
|
if (ourmesh != NULL) { |
76 |
|
|
77 |
|
|
78 |
|
int |
79 |
< |
cvpoly(mo, n, vp, vn, vc) /* convert a polygon to extended triangles */ |
80 |
< |
OBJECT mo; |
81 |
< |
int n; |
82 |
< |
FVECT *vp; |
83 |
< |
FVECT *vn; |
84 |
< |
RREAL (*vc)[2]; |
79 |
> |
cvpoly( /* convert a polygon to extended triangles */ |
80 |
> |
OBJECT mo, |
81 |
> |
int n, |
82 |
> |
FVECT *vp, |
83 |
> |
FVECT *vn, |
84 |
> |
RREAL (*vc)[2] |
85 |
> |
) |
86 |
|
{ |
87 |
|
int tcnt = 0; |
88 |
|
int flags; |
139 |
|
|
140 |
|
|
141 |
|
static void |
142 |
< |
add2bounds(vp, vc) /* add point and uv coordinate to bounds */ |
143 |
< |
FVECT vp; |
144 |
< |
RREAL vc[2]; |
142 |
> |
add2bounds( /* add point and uv coordinate to bounds */ |
143 |
> |
FVECT vp, |
144 |
> |
RREAL vc[2] |
145 |
> |
) |
146 |
|
{ |
147 |
|
register int j; |
148 |
|
|
164 |
|
|
165 |
|
|
166 |
|
int /* create an extended triangle */ |
167 |
< |
cvtri(mo, vp1, vp2, vp3, vn1, vn2, vn3, vc1, vc2, vc3) |
168 |
< |
OBJECT mo; |
169 |
< |
FVECT vp1, vp2, vp3; |
170 |
< |
FVECT vn1, vn2, vn3; |
171 |
< |
RREAL vc1[2], vc2[2], vc3[2]; |
167 |
> |
cvtri( |
168 |
> |
OBJECT mo, |
169 |
> |
FVECT vp1, |
170 |
> |
FVECT vp2, |
171 |
> |
FVECT vp3, |
172 |
> |
FVECT vn1, |
173 |
> |
FVECT vn2, |
174 |
> |
FVECT vn3, |
175 |
> |
RREAL vc1[2], |
176 |
> |
RREAL vc2[2], |
177 |
> |
RREAL vc3[2] |
178 |
> |
) |
179 |
|
{ |
180 |
|
static OBJECT fobj = OVOID; |
181 |
|
char buf[32]; |
218 |
|
fop = objptr(fobj); |
219 |
|
fop->omod = mo; |
220 |
|
fop->otype = OBJ_FACE; |
221 |
< |
sprintf(buf, "t%d", fobj); |
221 |
> |
sprintf(buf, "t%ld", fobj); |
222 |
|
fop->oname = savqstr(buf); |
223 |
|
fop->oargs.nfargs = 9; |
224 |
|
fop->oargs.farg = (RREAL *)malloc(9*sizeof(RREAL)); |
277 |
|
|
278 |
|
|
279 |
|
static OBJECT |
280 |
< |
cvmeshtri(obj) /* add an extended triangle to our mesh */ |
281 |
< |
OBJECT obj; |
280 |
> |
cvmeshtri( /* add an extended triangle to our mesh */ |
281 |
> |
OBJECT obj |
282 |
> |
) |
283 |
|
{ |
284 |
|
OBJREC *o = objptr(obj); |
285 |
|
TRIDATA *ts; |
315 |
|
|
316 |
|
|
317 |
|
void |
318 |
< |
cvmeshbounds() /* set mesh boundaries */ |
318 |
> |
cvmeshbounds(void) /* set mesh boundaries */ |
319 |
|
{ |
320 |
|
int i; |
321 |
|
|
352 |
|
|
353 |
|
|
354 |
|
static OCTREE |
355 |
< |
cvmeshoct(ot) /* convert triangles in subtree */ |
356 |
< |
OCTREE ot; |
355 |
> |
cvmeshoct( /* convert triangles in subtree */ |
356 |
> |
OCTREE ot |
357 |
> |
) |
358 |
|
{ |
359 |
|
int i; |
360 |
|
|
378 |
|
|
379 |
|
|
380 |
|
MESH * |
381 |
< |
cvmesh() /* convert mesh and octree leaf nodes */ |
381 |
> |
cvmesh(void) /* convert mesh and octree leaf nodes */ |
382 |
|
{ |
383 |
|
if (ourmesh == NULL) |
384 |
|
return(NULL); |