| 1 |
< |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
| 1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
|
static char SCCSid[] = "$SunId$ SGI"; |
| 109 |
|
} |
| 110 |
|
/* check settings */ |
| 111 |
|
checkvalues(); |
| 112 |
< |
/* load RIF if any */ |
| 112 |
> |
/* load rad input file */ |
| 113 |
|
getradfile(); |
| 114 |
|
|
| 115 |
|
if (hdlist[0] == NULL) { /* create new holodeck */ |
| 175 |
|
if (fstat(fd, &stbuf) < 0) |
| 176 |
|
error(SYSTEM, "cannot stat open holodeck file"); |
| 177 |
|
mod &= stbuf.st_mode; /* always more restrictive */ |
| 178 |
< |
if (mod == stbuf.st_mode) |
| 178 |
> |
if (mod == (stbuf.st_mode & 0777)) |
| 179 |
|
return(-1); /* already set */ |
| 180 |
|
/* else change it */ |
| 181 |
|
if (fchmod(fd, mod) < 0) { |
| 332 |
|
extern char *atos(); |
| 333 |
|
register int i; |
| 334 |
|
int n; |
| 335 |
< |
double len[3], maxlen, d; |
| 335 |
> |
double len[3], d; |
| 336 |
|
char buf[64]; |
| 337 |
|
|
| 338 |
|
if (!vdef(SECTION)) { |
| 366 |
|
&gp->xv[2][0], &gp->xv[2][1], &gp->xv[2][2], |
| 367 |
|
&gp->grid[0], &gp->grid[1], &gp->grid[2]) < 12) |
| 368 |
|
badvalue(SECTION); |
| 369 |
– |
maxlen = 0.; |
| 369 |
|
for (i = 0; i < 3; i++) |
| 370 |
< |
if ((len[i] = VLEN(gp->xv[i])) > maxlen) |
| 371 |
< |
maxlen = len[i]; |
| 372 |
< |
if (!vdef(GRID)) |
| 373 |
< |
d = 0.125*maxlen; |
| 374 |
< |
else if ((d = vflt(GRID)) <= FTINY) |
| 370 |
> |
len[i] = VLEN(gp->xv[i]); |
| 371 |
> |
if (!vdef(GRID)) { |
| 372 |
> |
d = 2/5e5*( len[0]*len[0]*(len[1]*len[1] + |
| 373 |
> |
len[2]*len[2] + 4*len[1]*len[2]) |
| 374 |
> |
+ len[1]*len[1]*len[2]*(len[2] + 4*len[0]) |
| 375 |
> |
+ 4*len[0]*len[1]*len[2]*len[2] ); |
| 376 |
> |
d = sqrt(sqrt(d)); |
| 377 |
> |
} else if ((d = vflt(GRID)) <= FTINY) |
| 378 |
|
badvalue(GRID); |
| 379 |
|
for (i = 0; i < 3; i++) |
| 380 |
|
if (gp->grid[i] <= 0) |