changeset 1048:40cde8c1a6cd default tip

add ScaleXY (not for allExecute...)
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 08 Dec 2010 06:22:15 +0900
parents 6a80ca9a65d9
children
files Renderer/Engine/sys.cc Renderer/Engine/sys.h
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/sys.cc	Wed Dec 08 05:38:45 2010 +0900
+++ b/Renderer/Engine/sys.cc	Wed Dec 08 06:22:15 2010 +0900
@@ -267,3 +267,19 @@
   }
 }
 
+void
+ScaleMatrix(float *m, float v)
+{
+    for(int i=0;i<16;i++)
+       m[i] *= v;
+}
+
+void
+ScaleMatrixXY(float *m, float x, float y)
+{
+    for(int i=0;i<3;i++) {
+       m[i] *= x;
+       m[i+4] *= y;
+    }
+}
+
--- a/Renderer/Engine/sys.h	Wed Dec 08 05:38:45 2010 +0900
+++ b/Renderer/Engine/sys.h	Wed Dec 08 06:22:15 2010 +0900
@@ -21,5 +21,7 @@
 void unitMatrix(float *m);
 void transMatrix(float *m0, float *m1, float *v);
 void ApplyMatrix(float *v1, float *v2);
+void ScaleMatrix(float *m, float v);
+void ScaleMatrixXY(float *m, float sx,float sy);
 
 #endif