comparison 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
comparison
equal deleted inserted replaced
30:e3ba2fa966f6 31:55973a3f1222
20 def scale(self, x, y, z): 20 def scale(self, x, y, z):
21 d1 = self.data 21 d1 = self.data
22 d1[0][:] = (a * x for a in d1[0]) 22 d1[0][:] = (a * x for a in d1[0])
23 d1[1][:] = (a * y for a in d1[1]) 23 d1[1][:] = (a * y for a in d1[1])
24 d1[2][:] = (a * z for a in d1[2]) 24 d1[2][:] = (a * z for a in d1[2])
25
26
27 def scale2d(self, x, y):
28 d1 = self.data
29 d1[0][:] = (a * x for a in d1[0])
30 d1[1][:] = (a * y for a in d1[1])
25 31
26 32
27 def translate(self, x, y, z): 33 def translate(self, x, y, z):
28 d1 = self.data 34 d1 = self.data
29 a, b, c = (v * m for v, m in zip(d1[3][:3], (x, y, z))) 35 a, b, c = (v * m for v, m in zip(d1[3][:3], (x, y, z)))