21 |
|
#define DO_NCMDS 10 /* number of object display commands */ |
22 |
|
|
23 |
|
/* commands entered on stdin only */ |
24 |
< |
#define DO_INIT {"load","unload","xform","move","unmove","dup",\ |
24 |
> |
#define DO_INIT {"load","clear","xform","move","unmove","dup",\ |
25 |
|
"show","light","hide","object"} |
26 |
|
|
27 |
|
/******************************************************************* |
44 |
|
dobj_command(cmd, args) : check/run object display command |
45 |
|
char *cmd, *args; : command name and argument string |
46 |
|
|
47 |
< |
Check to see if this is an object display command, and return the command |
48 |
< |
number after running it if it is, or -1 if it isn't. Error messages should |
47 |
> |
Check to see if this is an object display command, and return -1 if |
48 |
> |
it isn't. If it is a valid command that results in some visible |
49 |
> |
change, return non-zero, otherwise return 0. Error messages should |
50 |
|
be printed with error(COMMAND,err). |
51 |
|
|
52 |
|
|
53 |
|
double |
54 |
< |
dobj_trace(rorg, rdir) : check for ray intersection with objects |
54 |
> |
dobj_trace(nm, rorg, rdir) : check for ray intersection with objects |
55 |
> |
char nm[]; : object name (modified) |
56 |
|
FVECT rorg, rdir; : ray origin and direction |
57 |
|
|
58 |
< |
Check to see if the given ray intersects any of the visible objects, |
58 |
> |
Check to see if the given ray intersects the given object, |
59 |
|
returning the distance the ray traveled if it did, or FHUGE if it didn't. |
60 |
+ |
If nm contains "*", then all visible objects are checked and the name |
61 |
+ |
of the intersected object is returned, or "" if none. If nm is NULL, |
62 |
+ |
then all visible objects are checked, but the name is not returned. |
63 |
|
|
64 |
|
|
65 |
< |
void |
65 |
> |
int |
66 |
|
dobj_render() : render visible objects to OpenGL |
67 |
|
|
68 |
|
Renders all display objects using OpenGL, assuming desired view has |
69 |
|
been set. This routine also assumes that the tone-mapping library |
70 |
|
is being used to set exposure, and it queries this information to |
71 |
< |
adjust light sources as necessary for illuminated objects. |
71 |
> |
adjust light sources as necessary for illuminated objects. Returns |
72 |
> |
the number of objects rendered. |
73 |
|
|
74 |
|
|
75 |
|
void |