summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension
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/dimension
parentdf36a146277eaa442f09520da8d40b95107803d7 (diff)
downloaddimension-399bc22aff7f1042199cbc425d1df5264d1741af.tar.xz
geometry: Faster AABB transformations.
Diffstat (limited to 'libdimension/dimension')
-rw-r--r--libdimension/dimension/geometry.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libdimension/dimension/geometry.h b/libdimension/dimension/geometry.h
index 26dd608..b2ba551 100644
--- a/libdimension/dimension/geometry.h
+++ b/libdimension/dimension/geometry.h
@@ -170,6 +170,13 @@ dmnsn_new_matrix4(dmnsn_vector a, dmnsn_vector b, dmnsn_vector c,
return m;
}
+/** Extract column vectors from a matrix. */
+DMNSN_INLINE dmnsn_vector
+dmnsn_matrix_column(dmnsn_matrix M, unsigned int i)
+{
+ return dmnsn_new_vector(M.n[0][i], M.n[1][i], M.n[2][i]);
+}
+
/** Return the identity matrix. */
dmnsn_matrix dmnsn_identity_matrix(void);