diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2014-05-22 18:16:16 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2014-05-22 18:16:16 -0400 |
commit | 79508ee5172600a5aefad2473b73e1fd2d9b2164 (patch) | |
tree | 9eb47b4d7eca53568ccd646d60c9a00a0febd8d8 /libdimension/dimension | |
parent | 95acde693f9d217b9a035585cd9087042503727e (diff) | |
download | dimension-79508ee5172600a5aefad2473b73e1fd2d9b2164.tar.xz |
geometry: Add a matrix constructor from column vectors.
Diffstat (limited to 'libdimension/dimension')
-rw-r--r-- | libdimension/dimension/geometry.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libdimension/dimension/geometry.h b/libdimension/dimension/geometry.h index 59fb285..d2479f3 100644 --- a/libdimension/dimension/geometry.h +++ b/libdimension/dimension/geometry.h @@ -159,6 +159,17 @@ dmnsn_new_matrix(double a0, double a1, double a2, double a3, return m; } +/** Construct a new transformation matrix from column vectors. */ +DMNSN_INLINE dmnsn_matrix +dmnsn_new_matrix4(dmnsn_vector a, dmnsn_vector b, dmnsn_vector c, + dmnsn_vector d) +{ + dmnsn_matrix m = { { { a.x, b.x, c.x, d.x }, + { a.y, b.y, c.y, d.y }, + { a.z, b.z, c.z, d.z } } }; + return m; +} + /** Return the identity matrix. */ dmnsn_matrix dmnsn_identity_matrix(void); |