summaryrefslogtreecommitdiff
path: root/test/raytracer/object.h
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2008-08-09 08:06:33 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2008-08-09 08:06:33 +0000
commit285f5bec5bb03d4e825e5d866e94008088dd6155 (patch)
tree9df69ded9ed4f4049e0b3887fdd99fcdf3b1746f /test/raytracer/object.h
parenta83f0c1710cc5143dd885e84c94e14f7d3216f93 (diff)
Ajout nouveaux tests
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@708 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/raytracer/object.h')
-rw-r--r--test/raytracer/object.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/raytracer/object.h b/test/raytracer/object.h
new file mode 100644
index 0000000..d890bda
--- /dev/null
+++ b/test/raytracer/object.h
@@ -0,0 +1,36 @@
+struct object {
+ enum { Cone, Cube, Cylinder, Plane, Sphere,
+ Union, Intersection, Difference } kind;
+ /* For base objects: Cone, Cube, Cylinder, Plane, Sphere */
+ struct closure surf; /* surface function */
+ struct matrix * world2obj, * obj2world;
+ flt max_scale_applied;
+ /* For compound objects: Union, Intersection, Difference */
+ struct object * o1, * o2;
+ /* For all objects: bounding sphere (center and radius) */
+ struct point center;
+ flt radius;
+};
+
+struct object * cone(struct closure * c);
+struct object * cube(struct closure * c);
+struct object * cylinder(struct closure * c);
+struct object * plane(struct closure * c);
+struct object * sphere(struct closure * c);
+
+struct object * orotatex(struct object * o1, flt a);
+struct object * orotatey(struct object * o1, flt a);
+struct object * orotatez(struct object * o1, flt a);
+struct object * oscale(struct object * o1, flt sx, flt sy, flt sz);
+struct object * otranslate(struct object * o1,
+ flt tx, flt ty, flt tz);
+struct object * ouscale(struct object * o1, flt s);
+
+struct object * odifference(struct object * o1, struct object * o2);
+struct object * ointersect(struct object * o1, struct object * o2);
+struct object * ounion(struct object * o1, struct object * o2);
+
+void normal_vector(struct object * obj, struct point * p, int face,
+ /*out*/ struct vector * n);
+
+#define BS_NOT_COMPUTED (-1.0)