summaryrefslogtreecommitdiff
path: root/maths.c
diff options
context:
space:
mode:
Diffstat (limited to 'maths.c')
-rw-r--r--maths.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/maths.c b/maths.c
index a0c9ed5..5ade946 100644
--- a/maths.c
+++ b/maths.c
@@ -180,6 +180,12 @@ void mtx_push_rot_z(int a) {
mtx_push(m);
}
+void mtx_push_scale(int s) {
+ int m[0x10];
+ mtx_scale(m, s);
+ mtx_push(m);
+}
+
int* mtx_pop(void) {
assert(mtx_stack_top > 0);
return mtx_stack[--mtx_stack_top];
@@ -234,6 +240,14 @@ int* mtx_rot_z(int* d, int a) {
return d;
}
+int* mtx_scale(int* d, int s) {
+ mtx_iden(d);
+ d[0] = s;
+ d[5] = s;
+ d[10] = s;
+ return d;
+}
+
int* mtx_apply(const int* m, int* v) {
int s[4];
vec_cpy(s, v, 4);