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 |
|
*/ |
5 |
+ |
#ifndef _RAD_RHDOBJ_H_ |
6 |
+ |
#define _RAD_RHDOBJ_H_ |
7 |
|
|
8 |
+ |
#ifdef __cplusplus |
9 |
+ |
extern "C" { |
10 |
+ |
#endif |
11 |
+ |
|
12 |
|
/* additional user commands */ |
13 |
|
#define DO_LOAD 0 /* load octree object */ |
14 |
|
#define DO_UNLOAD 1 /* unload (free) octree object */ |
24 |
|
#define DO_NCMDS 10 /* number of object display commands */ |
25 |
|
|
26 |
|
/* commands entered on stdin only */ |
27 |
< |
#define DO_INIT {"load","unload","xform","move","unmove","dup",\ |
27 |
> |
#define DO_INIT {"load","clear","xform","move","unmove","dup",\ |
28 |
|
"show","light","hide","object"} |
29 |
|
|
30 |
|
/******************************************************************* |
47 |
|
dobj_command(cmd, args) : check/run object display command |
48 |
|
char *cmd, *args; : command name and argument string |
49 |
|
|
50 |
< |
Check to see if this is an object display command, and return the command |
51 |
< |
number after running it if it is, or -1 if it isn't. Error messages should |
50 |
> |
Check to see if this is an object display command, and return -1 if |
51 |
> |
it isn't. If it is a valid command that results in some visible |
52 |
> |
change, return non-zero, otherwise return 0. Error messages should |
53 |
|
be printed with error(COMMAND,err). |
54 |
|
|
55 |
|
|
56 |
|
double |
57 |
< |
dobj_trace(rorg, rdir) : check for ray intersection with objects |
57 |
> |
dobj_trace(nm, rorg, rdir) : check for ray intersection with objects |
58 |
> |
char nm[]; : object name (modified) |
59 |
|
FVECT rorg, rdir; : ray origin and direction |
60 |
|
|
61 |
< |
Check to see if the given ray intersects any of the visible objects, |
61 |
> |
Check to see if the given ray intersects the given object, |
62 |
|
returning the distance the ray traveled if it did, or FHUGE if it didn't. |
63 |
+ |
If nm contains "*", then all visible objects are checked and the name |
64 |
+ |
of the intersected object is returned, or "" if none. If nm is NULL, |
65 |
+ |
then all visible objects are checked, but the name is not returned. |
66 |
|
|
67 |
|
|
68 |
< |
void |
68 |
> |
int |
69 |
|
dobj_render() : render visible objects to OpenGL |
70 |
|
|
71 |
|
Renders all display objects using OpenGL, assuming desired view has |
72 |
|
been set. This routine also assumes that the tone-mapping library |
73 |
|
is being used to set exposure, and it queries this information to |
74 |
< |
adjust light sources as necessary for illuminated objects. |
74 |
> |
adjust light sources as necessary for illuminated objects. Returns |
75 |
> |
the number of objects rendered. |
76 |
|
|
77 |
|
|
78 |
|
void |
154 |
|
extern char rhdcmd[DO_NCMDS][8]; |
155 |
|
|
156 |
|
extern int (*dobj_lightsamp)(); /* pointer to function to get lights */ |
157 |
+ |
|
158 |
+ |
#ifdef __cplusplus |
159 |
+ |
} |
160 |
+ |
#endif |
161 |
+ |
#endif /* _RAD_RHDOBJ_H_ */ |
162 |
+ |
|