• Home
  • Raw
  • Download

Lines Matching refs:Scalar

115 def toFloat(lst):	return [Scalar(float(v.x)) for v in lst]
116 def toInt(lst): return [Scalar(int(v.x)) for v in lst]
118 def toBool(lst): return [Scalar(bool(v.x)) for v in lst]
191 def isEqual(a, b): return Scalar(a.isEqual(b))
194 def isNotEqual(a, b): return Scalar(not a.isEqual(b))
228 class Scalar(object): class
232 def applyUnary(self, func): return Scalar(func(self.x))
233 def applyBinary(self, func, other): return Scalar(func(self.x, other.x))
235 def isEqual(self, other): assert isinstance(other, Scalar); return (self.x == other.x)
238 def toScalar(self): return Scalar(self.x)
255 def toFloat(self): return Scalar(float(self.x))
256 def toInt(self): return Scalar(int(self.x))
258 def toBool(self): return Scalar(bool(self.x))
283 return Scalar(abs(self.x))
286 assert isinstance(v, Scalar)
287 return Scalar(abs(self.x - v.x))
290 assert isinstance(v, Scalar)
291 return Scalar(self.x * v.x)
294 return Scalar(glslSign(self.x))
298 return Scalar(self.x)
300 return Scalar(abs(self.x))
303 return Scalar(-self.x)
306 if not isinstance(val, Scalar):
308 assert isinstance(val, Scalar)
309 return Scalar(self.x + val.x)
315 if isinstance(val, Scalar):
316 return Scalar(self.x * val.x)
327 if isinstance(val, Scalar):
328 return Scalar(self.x / val.x)
338 class Uint(Scalar):
347 return Scalar.abs(self).toUint()
350 return Scalar.__neg__(self).toUint()
353 return Scalar.__add__(self, val).toUint()
359 return Scalar.__mul__(self, val).toUint()
362 return Scalar.__div__(self, val).toUint()
368 if (len(lst) == 1): return Scalar(lst[0])
378 return Scalar(math.sqrt(self.dot(self).x))
381 return self * Scalar(1.0 / self.length().x)
407 def toScalar(self): return Scalar(self.x)
453 return Scalar(self.x*v.x + self.y*v.y)
465 if isinstance(val, Scalar):
476 if isinstance(val, Scalar):
482 if isinstance(val, Scalar):
488 def boolAny(self): return Scalar(self.x or self.y)
489 def boolAll(self): return Scalar(self.x and self.y)
518 def toScalar(self): return Scalar(self.x)
564 return Scalar(self.x*v.x + self.y*v.y + self.z*v.z)
582 if isinstance(val, Scalar):
593 if isinstance(val, Scalar):
599 if isinstance(val, Scalar):
606 def boolAny(self): return Scalar(self.x or self.y or self.z)
607 def boolAll(self): return Scalar(self.x and self.y and self.z)
637 def toScalar(self): return Scalar(self.x)
684 return Scalar(self.x*v.x + self.y*v.y + self.z*v.z + self.w*v.w)
696 if isinstance(val, Scalar):
707 if isinstance(val, Scalar):
713 if isinstance(val, Scalar):
720 def boolAny(self): return Scalar(self.x or self.y or self.z or self.w)
721 def boolAll(self): return Scalar(self.x and self.y and self.z and self.w)