diff pytouhou/utils/matrix.py @ 31:55973a3f1222

Some more optimization!
author Thibaut Girka <thib@sitedethib.com>
date Sat, 13 Aug 2011 00:02:11 +0200
parents e3ba2fa966f6
children c435e83a8e70
line wrap: on
line diff
--- a/pytouhou/utils/matrix.py
+++ b/pytouhou/utils/matrix.py
@@ -24,6 +24,12 @@ class Matrix(object):
         d1[2][:] = (a * z for a in d1[2])
 
 
+    def scale2d(self, x, y):
+        d1 = self.data
+        d1[0][:] = (a * x for a in d1[0])
+        d1[1][:] = (a * y for a in d1[1])
+
+
     def translate(self, x, y, z):
         d1 = self.data
         a, b, c = (v * m for v, m in zip(d1[3][:3], (x, y, z)))