--- ray/src/gen/mkillum.h 2007/12/05 20:07:34 2.13 +++ ray/src/gen/mkillum.h 2007/12/08 01:43:09 2.14 @@ -1,4 +1,4 @@ -/* RCSid: $Id: mkillum.h,v 2.13 2007/12/05 20:07:34 greg Exp $ */ +/* RCSid: $Id: mkillum.h,v 2.14 2007/12/08 01:43:09 greg Exp $ */ /* * Common definitions for mkillum */ @@ -7,6 +7,7 @@ #include "ray.h" #include "otypes.h" +#include "random.h" #ifdef __cplusplus extern "C" { @@ -29,22 +30,22 @@ typedef enum { } UpDir; /* BSDF coordinate calculation routines */ /* vectors always point away from surface */ -typedef int b_vecf(FVECT, int, char *); -typedef int b_ndxf(FVECT, char *); -typedef double b_radf(int, char *); +typedef int b_vecf(FVECT, int, void *); +typedef int b_ndxf(FVECT, void *); +typedef double b_radf(int, void *); /* Bidirectional Scattering Distribution Function */ struct BSDF_data { int ninc; /* number of incoming directions */ int nout; /* number of outgoing directions */ - char ib_priv[32]; /* input basis private data */ + void *ib_priv; /* input basis private data */ b_vecf *ib_vec; /* get input vector from index */ b_ndxf *ib_ndx; /* get input index from vector */ - b_radf *ib_rad; /* get input radius for index */ - char ob_priv[32]; /* output basis private data */ + b_radf *ib_ohm; /* get input radius for index */ + void *ob_priv; /* output basis private data */ b_vecf *ob_vec; /* get output vector from index */ b_ndxf *ob_ndx; /* get output index from vector */ - b_radf *ob_rad; /* get output radius for index */ + b_radf *ob_ohm; /* get output radius for index */ float *bsdf; /* scattering distribution data */ }; /* bidirectional scattering distrib. func. */ @@ -66,17 +67,17 @@ struct illum_args { #define getBSDF_incvec(v,b,i) (*(b)->ib_vec)(v,i,(b)->ib_priv) #define getBSDF_incndx(b,v) (*(b)->ib_ndx)(v,(b)->ib_priv) -#define getBSDF_incrad(b,i) (*(b)->ib_rad)(i,(b)->ib_priv) +#define getBSDF_incohm(b,i) (*(b)->ib_ohm)(i,(b)->ib_priv) #define getBSDF_outvec(v,b,o) (*(b)->ob_vec)(v,o,(b)->ob_priv) #define getBSDF_outndx(b,v) (*(b)->ob_ndx)(v,(b)->ob_priv) -#define getBSDF_outrad(b,o) (*(b)->ob_rad)(o,(b)->ob_priv) +#define getBSDF_outohm(b,o) (*(b)->ob_ohm)(o,(b)->ob_priv) #define BSDF_visible(b,i,o) (b)->bsdf[(o)*(b)->ninc + (i)] extern struct BSDF_data *load_BSDF(char *fname); extern void free_BSDF(struct BSDF_data *b); -extern void r_BSDF_incvec(FVECT v, struct BSDF_data *b, int i, +extern int r_BSDF_incvec(FVECT v, struct BSDF_data *b, int i, double rv, MAT4 xm); -extern void r_BSDF_outvec(FVECT v, struct BSDF_data *b, int o, +extern int r_BSDF_outvec(FVECT v, struct BSDF_data *b, int o, double rv, MAT4 xm); extern int getBSDF_xfm(MAT4 xm, FVECT nrm, UpDir ud); extern void redistribute(struct BSDF_data *b, int nalt, int nazi,