Lines Matching refs:Vec2
226 def toVec2(self): return Vec2(self.x, self.x)
283 elif isinstance(val, Vec2):
284 return Vec2(self.x * val.x, self.x * val.y)
295 elif isinstance(val, Vec2):
296 return Vec2(self.x / val.x, self.x / val.y)
309 elif (len(lst) == 2): return Vec2(lst[0], lst[1])
331 class Vec2(Vec): class
337 def applyUnary(self, func): return Vec2(func(self.x), func(self.y))
338 def applyBinary(self, func, other): return Vec2(func(self.x, other.x), func(self.y, other.y))
342 def toVec2(self): return Vec2(self.x, self.y)
347 def toFloat(self): return Vec2(float(self.x), float(self.y))
348 def toInt(self): return Vec2(int(self.x), int(self.y))
349 def toBool(self): return Vec2(bool(self.x), bool(self.y))
378 assert isinstance(v, Vec2)
382 assert isinstance(v, Vec2)
386 return Vec2(-self.x, -self.y)
390 return Vec2(self.x + val, self.y + val)
391 elif isinstance(val, Vec2):
392 return Vec2(self.x + val.x, self.y + val.y)
402 assert isinstance(val, Vec2)
403 return Vec2(self.x * val.x, self.y * val.y)
407 return Vec2(self.x / val.x, self.y / val.x)
409 assert isinstance(val, Vec2)
410 return Vec2(self.x / val.x, self.y / val.y)
414 def boolNot(self): return Vec2(not self.x, not self.y)
428 def toVec2(self): return Vec2(self.x, self.y)
520 def toVec2(self): return Vec2(self.x, self.y)