more stuff
[csgray] / src / csgimpl.h
1 #ifndef CSGIMPL_H_
2 #define CSGIMPL_H_
3
4 #include "csgray.h"
5
6 enum {
7         OB_NULL,
8         OB_SPHERE,
9         OB_CYLINDER,
10         OB_PLANE,
11         OB_BOX,
12         OB_UNION,
13         OB_INTERSECTION,
14         OB_SUBTRACTION
15 };
16
17 struct object {
18         int type;
19
20         float r, g, b;
21         float emr, emg, emb;
22         float roughness;
23         float opacity;
24
25         float xform[16], inv_xform[16];
26
27         csg_object *next;
28         csg_object *plt_next;
29
30         void (*destroy)(csg_object*);
31 };
32
33 struct sphere {
34         struct object ob;
35         float rad;
36 };
37
38 struct cylinder {
39         struct object ob;
40         float rad;
41 };
42
43 struct plane {
44         struct object ob;
45         float nx, ny, nz;
46         float d;
47 };
48
49 struct csgop {
50         struct object ob;
51         csg_object *a, *b;
52 };
53
54 union csg_object {
55         struct object ob;
56         struct sphere sph;
57         struct cylinder cyl;
58         struct plane plane;
59         struct csgop un, isect, sub;
60 };
61
62 struct camera {
63         float x, y, z;
64         float tx, ty, tz;
65         float fov;
66 };
67
68 #endif  /* CSGIMPL_H_ */