summaryrefslogtreecommitdiffstats
path: root/libdimension/bench
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-06-12 10:13:36 -0400
committerTavian Barnes <tavianator@tavianator.com>2014-06-12 10:14:07 -0400
commit399bc22aff7f1042199cbc425d1df5264d1741af (patch)
tree60e64f072340e4103ef5f670f40ada222ef27524 /libdimension/bench
parentdf36a146277eaa442f09520da8d40b95107803d7 (diff)
downloaddimension-399bc22aff7f1042199cbc425d1df5264d1741af.tar.xz
geometry: Faster AABB transformations.
Diffstat (limited to 'libdimension/bench')
-rw-r--r--libdimension/bench/geometry.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libdimension/bench/geometry.c b/libdimension/bench/geometry.c
index 56c8b58..68c9885 100644
--- a/libdimension/bench/geometry.c
+++ b/libdimension/bench/geometry.c
@@ -1,5 +1,5 @@
/*************************************************************************
- * Copyright (C) 2009-2011 Tavian Barnes <tavianator@tavianator.com> *
+ * Copyright (C) 2009-2014 Tavian Barnes <tavianator@tavianator.com> *
* *
* This file is part of The Dimension Benchmark Suite. *
* *
@@ -27,6 +27,7 @@ main(void)
dmnsn_vector vector, vector2;
dmnsn_matrix matrix, matrix2;
dmnsn_line line;
+ dmnsn_bounding_box box;
double result;
sandglass_t sandglass;
@@ -41,7 +42,7 @@ main(void)
});
printf("dmnsn_new_vector(): %ld\n", sandglass.grains);
- // dmnsn_matrix_construct()
+ // dmnsn_new_matrix()
sandglass_bench_fine(&sandglass, {
matrix = dmnsn_new_matrix(1.0, 1.0, 0.0, 0.0,
1.0, 1.0, 1.0, 0.0,
@@ -80,6 +81,13 @@ main(void)
});
printf("dmnsn_new_line(): %ld\n", sandglass.grains);
+ // dmnsn_new_bounding_box()
+ vector2 = dmnsn_new_vector(3.0, 4.0, 5.0);
+ sandglass_bench_fine(&sandglass, {
+ box = dmnsn_new_bounding_box(vector, vector2);
+ });
+ printf("dmnsn_new_bounding_box(): %ld\n", sandglass.grains);
+
// dmnsn_vector_add()
sandglass_bench_fine(&sandglass, {
vector = dmnsn_vector_add(vector, vector2);
@@ -173,6 +181,12 @@ main(void)
});
printf("dmnsn_transform_line(): %ld\n", sandglass.grains);
+ // dmnsn_transform_bounding_box()
+ sandglass_bench_fine(&sandglass, {
+ box = dmnsn_transform_bounding_box(matrix, box);
+ });
+ printf("dmnsn_transform_bounding_box(): %ld\n", sandglass.grains);
+
// dmnsn_line_point()
sandglass_bench_fine(&sandglass, {
vector = dmnsn_line_point(line, result);