Lines Matching full:self
33 def __init__(self, name, description, children): argument
34 self.name = name
35 self.description = description
36 self.children = children
39 def __init__(self): argument
144 def __init__(self): argument
147 def uniformVec4(self, count, mn, mx): argument
154 def uniformBVec4(self, count): argument
160 # def uniform(self,
229 def __init__(self, x): argument
230 self.x = x
232 def applyUnary(self, func): return Scalar(func(self.x)) argument
233 def applyBinary(self, func, other): return Scalar(func(self.x, other.x)) argument
235 def isEqual(self, other): assert isinstance(other, Scalar); return (self.x == other.x) argument
237 def expandVec(self, val): return val argument
238 def toScalar(self): return Scalar(self.x) argument
239 def toVec2(self): return Vec2(self.x, self.x) argument
240 def toVec3(self): return Vec3(self.x, self.x, self.x) argument
241 def toVec4(self): return Vec4(self.x, self.x, self.x, self.x) argument
242 def toUVec2(self): return UVec2(self.x, self.x) argument
243 def toUVec3(self): return UVec3(self.x, self.x, self.x) argument
244 def toUVec4(self): return UVec4(self.x, self.x, self.x, self.x) argument
245 def toMat2(self): return Mat.fromScalar(2, 2, float(self.x)) argument
246 def toMat2x3(self): return Mat.fromScalar(2, 3, float(self.x)) argument
247 def toMat2x4(self): return Mat.fromScalar(2, 4, float(self.x)) argument
248 def toMat3x2(self): return Mat.fromScalar(3, 2, float(self.x)) argument
249 def toMat3(self): return Mat.fromScalar(3, 3, float(self.x)) argument
250 def toMat3x4(self): return Mat.fromScalar(3, 4, float(self.x)) argument
251 def toMat4x2(self): return Mat.fromScalar(4, 2, float(self.x)) argument
252 def toMat4x3(self): return Mat.fromScalar(4, 3, float(self.x)) argument
253 def toMat4(self): return Mat.fromScalar(4, 4, float(self.x)) argument
255 def toFloat(self): return Scalar(float(self.x)) argument
256 def toInt(self): return Scalar(int(self.x)) argument
257 def toUint(self): return Uint(int(self.x)) argument
258 def toBool(self): return Scalar(bool(self.x)) argument
260 def getNumScalars(self): return 1 argument
261 def getScalars(self): return [self.x] argument
263 def typeString(self): argument
264 if isinstance(self.x, bool):
266 elif isinstance(self.x, int):
268 elif isinstance(self.x, float):
273 def vec4Swizzle(self): argument
276 def __str__(self): argument
277 return str(self.x).lower()
279 def __float__(self): argument
280 return float(self.x)
282 def length(self): argument
283 return Scalar(abs(self.x))
285 def distance(self, v): argument
287 return Scalar(abs(self.x - v.x))
289 def dot(self, v): argument
291 return Scalar(self.x * v.x)
293 def normalize(self): argument
294 return Scalar(glslSign(self.x))
296 def abs(self): argument
297 if isinstance(self.x, bool):
298 return Scalar(self.x)
300 return Scalar(abs(self.x))
302 def __neg__(self): argument
303 return Scalar(-self.x)
305 def __add__(self, val): argument
309 return Scalar(self.x + val.x)
311 def __sub__(self, val): argument
312 return self + (-val)
314 def __mul__(self, val): argument
316 return Scalar(self.x * val.x)
318 return Vec2(self.x * val.x, self.x * val.y)
320 return Vec3(self.x * val.x, self.x * val.y, self.x * val.z)
322 return Vec4(self.x * val.x, self.x * val.y, self.x * val.z, self.x * val.w)
326 def __div__(self, val): argument
328 return Scalar(self.x / val.x)
330 return Vec2(self.x / val.x, self.x / val.y)
332 return Vec3(self.x / val.x, self.x / val.y, self.x / val.z)
334 return Vec4(self.x / val.x, self.x / val.y, self.x / val.z, self.x / val.w)
339 def __init__(self, x): argument
341 self.x = x
343 def typeString(self): argument
346 def abs(self): argument
347 return Scalar.abs(self).toUint()
349 def __neg__(self): argument
350 return Scalar.__neg__(self).toUint()
352 def __add__(self, val): argument
353 return Scalar.__add__(self, val).toUint()
355 def __sub__(self, val): argument
356 return self + (-val)
358 def __mul__(self, val): argument
359 return Scalar.__mul__(self, val).toUint()
361 def __div__(self, val): argument
362 return Scalar.__div__(self, val).toUint()
373 def isEqual(self, other): argument
375 return (self.getScalars() == other.getScalars())
377 def length(self): argument
378 return Scalar(math.sqrt(self.dot(self).x))
380 def normalize(self): argument
381 return self * Scalar(1.0 / self.length().x)
383 def swizzle(self, indexList): argument
384 inScalars = self.getScalars()
388 def __init__(self): argument
391 def __eq__(self, other): argument
392 return self.isEqual(other)
394 def __ne__(self, other): argument
395 return not self.isEqual(other)
398 def __init__(self, x, y): argument
400 self.x = x
401 self.y = y
403 def applyUnary(self, func): return Vec2(func(self.x), func(self.y)) argument
404 def applyBinary(self, func, other): return Vec2(func(self.x, other.x), func(self.y, other.y)) argument
406 def expandVec(self, val): return val.toVec2() argument
407 def toScalar(self): return Scalar(self.x) argument
408 def toVec2(self): return Vec2(self.x, self.y) argument
409 def toVec3(self): return Vec3(self.x, self.y, 0.0) argument
410 def toVec4(self): return Vec4(self.x, self.y, 0.0, 0.0) argument
411 def toUVec2(self): return UVec2(self.x, self.y) argument
412 def toUVec3(self): return UVec3(self.x, self.y, 0.0) argument
413 def toUVec4(self): return UVec4(self.x, self.y, 0.0, 0.0) argument
414 def toMat2(self): return Mat2(float(self.x), 0.0, 0.0, float(self.y)); argument
416 def toFloat(self): return Vec2(float(self.x), float(self.y)) argument
417 def toInt(self): return Vec2(int(self.x), int(self.y)) argument
418 def toUint(self): return UVec2(int(self.x), int(self.y)) argument
419 def toBool(self): return Vec2(bool(self.x), bool(self.y)) argument
421 def getNumScalars(self): return 2 argument
422 def getScalars(self): return [self.x, self.y] argument
424 def typeString(self): argument
425 if isinstance(self.x, bool):
427 elif isinstance(self.x, int):
429 elif isinstance(self.x, float):
434 def vec4Swizzle(self): argument
437 def __str__(self): argument
438 if isinstance(self.x, bool):
439 return "bvec2(%s, %s)" % (str(self.x).lower(), str(self.y).lower())
440 elif isinstance(self.x, int):
441 return "ivec2(%i, %i)" % (self.x, self.y)
442 elif isinstance(self.x, float):
443 return "vec2(%s, %s)" % (self.x, self.y)
447 def distance(self, v): argument
449 return (self - v).length()
451 def dot(self, v): argument
453 return Scalar(self.x*v.x + self.y*v.y)
455 def abs(self): argument
456 if isinstance(self.x, bool):
457 return Vec2(self.x, self.y)
459 return Vec2(abs(self.x), abs(self.y))
461 def __neg__(self): argument
462 return Vec2(-self.x, -self.y)
464 def __add__(self, val): argument
466 return Vec2(self.x + val, self.y + val)
468 return Vec2(self.x + val.x, self.y + val.y)
472 def __sub__(self, val): argument
473 return self + (-val)
475 def __mul__(self, val): argument
479 return Vec2(self.x * val.x, self.y * val.y)
481 def __div__(self, val): argument
483 return Vec2(self.x / val.x, self.y / val.x)
486 return Vec2(self.x / val.x, self.y / val.y)
488 def boolAny(self): return Scalar(self.x or self.y) argument
489 def boolAll(self): return Scalar(self.x and self.y) argument
490 def boolNot(self): return Vec2(not self.x, not self.y) argument
493 def __init__(self, x, y): argument
496 Vec2.__init__(self, x, y)
498 def typeString(self): argument
501 def __str__(self): argument
502 return "uvec2(%i, %i)" % (self.x, self.y)
504 def abs(self): argument
505 return Vec2.abs(self).toUint()
508 def __init__(self, x, y, z): argument
510 self.x = x
511 self.y = y
512 self.z = z
514 def applyUnary(self, func): return Vec3(func(self.x), func(self.y), func(self.z)) argument
515 …def applyBinary(self, func, other): return Vec3(func(self.x, other.x), func(self.y, other.y), func… argument
517 def expandVec(self, val): return val.toVec3() argument
518 def toScalar(self): return Scalar(self.x) argument
519 def toVec2(self): return Vec2(self.x, self.y) argument
520 def toVec3(self): return Vec3(self.x, self.y, self.z) argument
521 def toVec4(self): return Vec4(self.x, self.y, self.z, 0.0) argument
522 def toUVec2(self): return UVec2(self.x, self.y) argument
523 def toUVec3(self): return UVec3(self.x, self.y, self.z) argument
524 def toUVec4(self): return UVec4(self.x, self.y, self.z, 0.0) argument
525 …def toMat3(self): return Mat3(float(self.x), 0.0, 0.0, 0.0, float(self.y), 0.0, 0.0, 0.0, floa… argument
527 def toFloat(self): return Vec3(float(self.x), float(self.y), float(self.z)) argument
528 def toInt(self): return Vec3(int(self.x), int(self.y), int(self.z)) argument
529 def toUint(self): return UVec3(int(self.x), int(self.y), int(self.z)) argument
530 def toBool(self): return Vec3(bool(self.x), bool(self.y), bool(self.z)) argument
532 def getNumScalars(self): return 3 argument
533 def getScalars(self): return [self.x, self.y, self.z] argument
535 def typeString(self): argument
536 if isinstance(self.x, bool):
538 elif isinstance(self.x, int):
540 elif isinstance(self.x, float):
545 def vec4Swizzle(self): argument
548 def __str__(self): argument
549 if isinstance(self.x, bool):
550 return "bvec3(%s, %s, %s)" % (str(self.x).lower(), str(self.y).lower(), str(self.z).lower())
551 elif isinstance(self.x, int):
552 return "ivec3(%i, %i, %i)" % (self.x, self.y, self.z)
553 elif isinstance(self.x, float):
554 return "vec3(%s, %s, %s)" % (self.x, self.y, self.z)
558 def distance(self, v): argument
560 return (self - v).length()
562 def dot(self, v): argument
564 return Scalar(self.x*v.x + self.y*v.y + self.z*v.z)
566 def cross(self, v): argument
568 return Vec3(self.y*v.z - v.y*self.z,
569 self.z*v.x - v.z*self.x,
570 self.x*v.y - v.x*self.y)
572 def abs(self): argument
573 if isinstance(self.x, bool):
574 return Vec3(self.x, self.y, self.z)
576 return Vec3(abs(self.x), abs(self.y), abs(self.z))
578 def __neg__(self): argument
579 return Vec3(-self.x, -self.y, -self.z)
581 def __add__(self, val): argument
583 return Vec3(self.x + val, self.y + val)
585 return Vec3(self.x + val.x, self.y + val.y, self.z + val.z)
589 def __sub__(self, val): argument
590 return self + (-val)
592 def __mul__(self, val): argument
596 return Vec3(self.x * val.x, self.y * val.y, self.z * val.z)
598 def __div__(self, val): argument
600 return Vec3(self.x / val.x, self.y / val.x, self.z / val.x)
602 return Vec3(self.x / val.x, self.y / val.y, self.z / val.z)
606 def boolAny(self): return Scalar(self.x or self.y or self.z) argument
607 def boolAll(self): return Scalar(self.x and self.y and self.z) argument
608 def boolNot(self): return Vec3(not self.x, not self.y, not self.z) argument
611 def __init__(self, x, y, z): argument
614 Vec3.__init__(self, x, y, z)
616 def typeString(self): argument
619 def __str__(self): argument
620 return "uvec3(%i, %i, %i)" % (self.x, self.y, self.z)
622 def abs(self): argument
623 return Vec3.abs(self).toUint()
626 def __init__(self, x, y, z, w): argument
628 self.x = x
629 self.y = y
630 self.z = z
631 self.w = w
633 def applyUnary(self, func): return Vec4(func(self.x), func(self.y), func(self.z), func(self.w)) argument
634 …def applyBinary(self, func, other): return Vec4(func(self.x, other.x), func(self.y, other.y), func… argument
636 def expandVec(self, val): return val.toVec4() argument
637 def toScalar(self): return Scalar(self.x) argument
638 def toVec2(self): return Vec2(self.x, self.y) argument
639 def toVec3(self): return Vec3(self.x, self.y, self.z) argument
640 def toVec4(self): return Vec4(self.x, self.y, self.z, self.w) argument
641 def toUVec2(self): return UVec2(self.x, self.y) argument
642 def toUVec3(self): return UVec3(self.x, self.y, self.z) argument
643 def toUVec4(self): return UVec4(self.x, self.y, self.z, self.w) argument
644 def toMat2(self): return Mat2(float(self.x), float(self.y), float(self.z), float(self.w)) argument
645 …toMat4(self): return Mat4(float(self.x), 0.0, 0.0, 0.0, 0.0, float(self.y), 0.0, 0.0, 0.0, 0.0… argument
647 def toFloat(self): return Vec4(float(self.x), float(self.y), float(self.z), float(self.w)) argument
648 def toInt(self): return Vec4(int(self.x), int(self.y), int(self.z), int(self.w)) argument
649 def toUint(self): return UVec4(int(self.x), int(self.y), int(self.z), int(self.w)) argument
650 def toBool(self): return Vec4(bool(self.x), bool(self.y), bool(self.z), bool(self.w)) argument
652 def getNumScalars(self): return 4 argument
653 def getScalars(self): return [self.x, self.y, self.z, self.w] argument
655 def typeString(self): argument
656 if isinstance(self.x, bool):
658 elif isinstance(self.x, int):
660 elif isinstance(self.x, float):
665 def vec4Swizzle(self): argument
668 def __str__(self): argument
669 if isinstance(self.x, bool):
670 …return "bvec4(%s, %s, %s, %s)" % (str(self.x).lower(), str(self.y).lower(), str(self.z).lower(), s…
671 elif isinstance(self.x, int):
672 return "ivec4(%i, %i, %i, %i)" % (self.x, self.y, self.z, self.w)
673 elif isinstance(self.x, float):
674 return "vec4(%s, %s, %s, %s)" % (self.x, self.y, self.z, self.w)
678 def distance(self, v): argument
680 return (self - v).length()
682 def dot(self, v): argument
684 return Scalar(self.x*v.x + self.y*v.y + self.z*v.z + self.w*v.w)
686 def abs(self): argument
687 if isinstance(self.x, bool):
688 return Vec4(self.x, self.y, self.z, self.w)
690 return Vec4(abs(self.x), abs(self.y), abs(self.z), abs(self.w))
692 def __neg__(self): argument
693 return Vec4(-self.x, -self.y, -self.z, -self.w)
695 def __add__(self, val): argument
697 return Vec3(self.x + val, self.y + val)
699 return Vec4(self.x + val.x, self.y + val.y, self.z + val.z, self.w + val.w)
703 def __sub__(self, val): argument
704 return self + (-val)
706 def __mul__(self, val): argument
710 return Vec4(self.x * val.x, self.y * val.y, self.z * val.z, self.w * val.w)
712 def __div__(self, val): argument
714 return Vec4(self.x / val.x, self.y / val.x, self.z / val.x, self.w / val.x)
716 return Vec4(self.x / val.x, self.y / val.y, self.z / val.z, self.w / val.w)
720 def boolAny(self): return Scalar(self.x or self.y or self.z or self.w) argument
721 def boolAll(self): return Scalar(self.x and self.y and self.z and self.w) argument
722 def boolNot(self): return Vec4(not self.x, not self.y, not self.z, not self.w) argument
725 def __init__(self, x, y, z, w): argument
728 Vec4.__init__(self, x, y, z, w)
730 def typeString(self): argument
733 def __str__(self): argument
734 return "uvec4(%i, %i, %i, %i)" % (self.x, self.y, self.z, self.w)
736 def abs(self): argument
737 return Vec4.abs(self).toUint()
741 def __init__ (self, numCols, numRows, scalars): argument
743 self.numCols = numCols
744 self.numRows = numRows
745 self.scalars = scalars
759 def get (self, colNdx, rowNdx): argument
760 assert 0 <= colNdx and colNdx < self.numCols
761 assert 0 <= rowNdx and rowNdx < self.numRows
762 return self.scalars[colNdx*self.numRows + rowNdx]
764 def set (self, colNdx, rowNdx, scalar): argument
765 assert 0 <= colNdx and colNdx < self.numCols
766 assert 0 <= rowNdx and rowNdx < self.numRows
767 self.scalars[colNdx*self.numRows + rowNdx] = scalar
769 def toMatrix (self, numCols, numRows): argument
771 for col in range(0, min(self.numCols, numCols)):
772 for row in range(0, min(self.numRows, numRows)):
773 res.set(col, row, self.get(col, row))
776 def toMat2 (self): return self.toMatrix(2, 2) argument
777 def toMat2x3 (self): return self.toMatrix(2, 3) argument
778 def toMat2x4 (self): return self.toMatrix(2, 4) argument
779 def toMat3x2 (self): return self.toMatrix(3, 2) argument
780 def toMat3 (self): return self.toMatrix(3, 3) argument
781 def toMat3x4 (self): return self.toMatrix(3, 4) argument
782 def toMat4x2 (self): return self.toMatrix(4, 2) argument
783 def toMat4x3 (self): return self.toMatrix(4, 3) argument
784 def toMat4 (self): return self.toMatrix(4, 4) argument
786 def typeString(self): argument
787 if self.numRows == self.numCols:
788 return "mat%d" % self.numRows
790 return "mat%dx%d" % (self.numCols, self.numRows)
792 def __str__(self): argument
793 return "%s(%s)" % (self.typeString(), ", ".join(["%s" % s for s in self.scalars]))
795 def isTypeEqual (self, other): argument
796 return isinstance(other, Mat) and self.numRows == other.numRows and self.numCols == other.numCols
798 def isEqual(self, other): argument
799 assert self.isTypeEqual(other)
800 return (self.scalars == other.scalars)
802 def compMul(self, val): argument
803 assert self.isTypeEqual(val)
804 …return Mat(self.numRows, self.numCols, [self.scalars(i) * val.scalars(i) for i in range(self.numRo…
807 def __init__(self, m00, m01, m10, m11): argument
808 Mat.__init__(self, 2, 2, [m00, m10, m01, m11])
811 def __init__(self, m00, m01, m02, m10, m11, m12, m20, m21, m22): argument
812 Mat.__init__(self, 3, 3, [m00, m10, m20,
817 def __init__(self, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33): argument
818 Mat.__init__(self, 4, 4, [m00, m10, m20, m30,