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