5 #include "cgmath/cgmath.h"
13 enum rt_obj_type { RT_SPH, RT_PLANE };
16 enum rt_obj_type type; \
36 enum rt_obj_type type;
61 /* scene management */
62 void rt_init(struct rtscene *scn);
63 void rt_destroy(struct rtscene *scn);
65 void rt_color(float r, float g, float b);
66 void rt_specular(float r, float g, float b);
67 void rt_shininess(float s);
69 union rtobject *rt_add_sphere(struct rtscene *scn, float x, float y, float z, float r);
70 union rtobject *rt_add_plane(struct rtscene *scn, float nx, float ny, float nz, float d);
71 struct rtlight *rt_add_light(struct rtscene *scn, float x, float y, float z);
73 /* returns 0 for no hit */
74 int ray_trace(cgm_ray *ray, struct rtscene *scn, int lvl, cgm_vec3 *color);
76 int ray_object(cgm_ray *ray, union rtobject *obj, float maxt, struct rayhit *hit);
77 int ray_scene(cgm_ray *ray, struct rtscene *scn, float maxt, struct rayhit *hit);
78 int ray_sphere(cgm_ray *ray, struct rtsphere *sph, float maxt, struct rayhit *hit);
79 int ray_plane(cgm_ray *ray, struct rtplane *plane, float maxt, struct rayhit *hit);