Back to index

radiance  4R0+20100331
face.h
Go to the documentation of this file.
00001 /* RCSid $Id: face.h,v 2.6 2003/06/27 06:53:21 greg Exp $ */
00002 /*
00003  *  face.h - header for routines using polygonal faces.
00004  */
00005 #ifndef _RAD_FACE_H_
00006 #define _RAD_FACE_H_
00007 #ifdef __cplusplus
00008 extern "C" {
00009 #endif
00010 
00011 #define  VERTEX(f,n) ((f)->va + 3*(n))
00012 
00013 typedef struct {     /* a polygonal face */
00014        FVECT  norm;         /* the plane's unit normal */
00015        RREAL  offset;              /* plane equation:  DOT(norm, v) == offset */
00016        RREAL  area;         /* area of face */
00017        RREAL  *va;          /* vertex array (o->oargs.farg) */
00018        short  nv;           /* # of vertices */
00019        short  ax;           /* axis closest to normal */
00020 } FACE;
00021 
00022 
00023 extern FACE  *getface(OBJREC *o);
00024 extern void  freeface(OBJREC *o);
00025 extern int  inface(FVECT p, FACE *f);
00026 
00027 
00028 #ifdef __cplusplus
00029 }
00030 #endif
00031 #endif /* _RAD_FACE_H_ */
00032