4 #include <cgmath/cgmath.h>
11 typedef int (*erb_intersect_func)(struct erb_surf *surf, struct erb_ray *ray, struct erb_hit *hit);
12 typedef void (*erb_sample_func)(struct erb_surf *surf, cgm_vec3 *pos);
15 struct erb_node *par; /* parent node */
16 struct erb_node *clist; /* child nodes */
17 struct erb_surf *surflist; /* surfaces in this node */
18 float xform[16], inv_xform[16]; /* global transformation */
19 float node_xform[16], inv_node_xform[16]; /* local transformation */
23 struct erb_node *node; /* transformation node for this surface */
25 erb_intersect_func isect; /* intersection routine */
26 erb_sample_func sample; /* random sample generation */
30 cgm_vec3 o, d; /* origin and direction */
31 float tmin, tmax; /* segment bounds */
32 float ior; /* IOR of the medium through which this ray travels */
33 float total_dist; /* travel distance accumulator */
38 struct erb_surf *surf;
42 void erb_cleanup(void);
44 #endif /* RENDLIB_H_ */