From c3e8914018f3ee262d5e3aef0be7f7d26728a412 Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 10 Aug 2004 02:10:12 +0000 Subject: [PATCH] added identitymatrix const struct which can be used wherever git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4328 d7cf8633-e32d-0410-b094-e92efae38249 --- matrixlib.c | 10 ++++++++++ matrixlib.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/matrixlib.c b/matrixlib.c index a036d822..550a5118 100644 --- a/matrixlib.c +++ b/matrixlib.c @@ -2,6 +2,16 @@ #include #include "matrixlib.h" +const matrix4x4_t identitymatrix = +{ + { + {1, 0, 0, 0}, + {0, 1, 0, 0}, + {0, 0, 1, 0}, + {0, 0, 0, 1} + } +}; + void Matrix4x4_Copy (matrix4x4_t *out, const matrix4x4_t *in) { *out = *in; diff --git a/matrixlib.h b/matrixlib.h index 87b09f84..06890e29 100644 --- a/matrixlib.h +++ b/matrixlib.h @@ -12,6 +12,8 @@ typedef struct matrix4x4_s } matrix4x4_t; +extern const matrix4x4_t identitymatrix; + // functions for manipulating 4x4 matrices // copy a matrix4x4 -- 2.39.2