Lines Matching refs:self

11 	def __init__(self, name, description, children):  argument
12 self.name = name
13 self.description = description
14 self.children = children
17 def __init__(self): argument
122 def __init__(self): argument
125 def uniformVec4(self, count, mn, mx): argument
132 def uniformBVec4(self, count): argument
207 def __init__(self, x): argument
208 self.x = x
210 def applyUnary(self, func): return Scalar(func(self.x)) argument
211 def applyBinary(self, func, other): return Scalar(func(self.x, other.x)) argument
213 def isEqual(self, other): assert isinstance(other, Scalar); return (self.x == other.x) argument
215 def expandVec(self, val): return val argument
216 def toScalar(self): return Scalar(self.x) argument
217 def toVec2(self): return Vec2(self.x, self.x) argument
218 def toVec3(self): return Vec3(self.x, self.x, self.x) argument
219 def toVec4(self): return Vec4(self.x, self.x, self.x, self.x) argument
220 def toUVec2(self): return UVec2(self.x, self.x) argument
221 def toUVec3(self): return UVec3(self.x, self.x, self.x) argument
222 def toUVec4(self): return UVec4(self.x, self.x, self.x, self.x) argument
223 def toMat2(self): return Mat.fromScalar(2, 2, float(self.x)) argument
224 def toMat2x3(self): return Mat.fromScalar(2, 3, float(self.x)) argument
225 def toMat2x4(self): return Mat.fromScalar(2, 4, float(self.x)) argument
226 def toMat3x2(self): return Mat.fromScalar(3, 2, float(self.x)) argument
227 def toMat3(self): return Mat.fromScalar(3, 3, float(self.x)) argument
228 def toMat3x4(self): return Mat.fromScalar(3, 4, float(self.x)) argument
229 def toMat4x2(self): return Mat.fromScalar(4, 2, float(self.x)) argument
230 def toMat4x3(self): return Mat.fromScalar(4, 3, float(self.x)) argument
231 def toMat4(self): return Mat.fromScalar(4, 4, float(self.x)) argument
233 def toFloat(self): return Scalar(float(self.x)) argument
234 def toInt(self): return Scalar(int(self.x)) argument
235 def toUint(self): return Uint(int(self.x)) argument
236 def toBool(self): return Scalar(bool(self.x)) argument
238 def getNumScalars(self): return 1 argument
239 def getScalars(self): return [self.x] argument
241 def typeString(self): argument
242 if isinstance(self.x, bool):
244 elif isinstance(self.x, int):
246 elif isinstance(self.x, float):
251 def vec4Swizzle(self): argument
254 def __str__(self): argument
255 return str(self.x).lower()
257 def __float__(self): argument
258 return float(self.x)
260 def length(self): argument
261 return Scalar(abs(self.x))
263 def distance(self, v): argument
265 return Scalar(abs(self.x - v.x))
267 def dot(self, v): argument
269 return Scalar(self.x * v.x)
271 def normalize(self): argument
272 return Scalar(glslSign(self.x))
274 def abs(self): argument
275 if isinstance(self.x, bool):
276 return Scalar(self.x)
278 return Scalar(abs(self.x))
280 def __neg__(self): argument
281 return Scalar(-self.x)
283 def __add__(self, val): argument
287 return Scalar(self.x + val.x)
289 def __sub__(self, val): argument
290 return self + (-val)
292 def __mul__(self, val): argument
294 return Scalar(self.x * val.x)
296 return Vec2(self.x * val.x, self.x * val.y)
298 return Vec3(self.x * val.x, self.x * val.y, self.x * val.z)
300 return Vec4(self.x * val.x, self.x * val.y, self.x * val.z, self.x * val.w)
304 def __div__(self, val): argument
306 return Scalar(self.x / val.x)
308 return Vec2(self.x / val.x, self.x / val.y)
310 return Vec3(self.x / val.x, self.x / val.y, self.x / val.z)
312 return Vec4(self.x / val.x, self.x / val.y, self.x / val.z, self.x / val.w)
317 def __init__(self, x): argument
319 self.x = x
321 def typeString(self): argument
324 def abs(self): argument
325 return Scalar.abs(self).toUint()
327 def __neg__(self): argument
328 return Scalar.__neg__(self).toUint()
330 def __add__(self, val): argument
331 return Scalar.__add__(self, val).toUint()
333 def __sub__(self, val): argument
334 return self + (-val)
336 def __mul__(self, val): argument
337 return Scalar.__mul__(self, val).toUint()
339 def __div__(self, val): argument
340 return Scalar.__div__(self, val).toUint()
351 def isEqual(self, other): argument
353 return (self.getScalars() == other.getScalars())
355 def length(self): argument
356 return Scalar(math.sqrt(self.dot(self).x))
358 def normalize(self): argument
359 return self * Scalar(1.0 / self.length().x)
361 def swizzle(self, indexList): argument
362 inScalars = self.getScalars()
366 def __init__(self): argument
369 def __eq__(self, other): argument
370 return self.isEqual(other)
372 def __ne__(self, other): argument
373 return not self.isEqual(other)
376 def __init__(self, x, y): argument
378 self.x = x
379 self.y = y
381 def applyUnary(self, func): return Vec2(func(self.x), func(self.y)) argument
382 def applyBinary(self, func, other): return Vec2(func(self.x, other.x), func(self.y, other.y)) argument
384 def expandVec(self, val): return val.toVec2() argument
385 def toScalar(self): return Scalar(self.x) argument
386 def toVec2(self): return Vec2(self.x, self.y) argument
387 def toVec3(self): return Vec3(self.x, self.y, 0.0) argument
388 def toVec4(self): return Vec4(self.x, self.y, 0.0, 0.0) argument
389 def toUVec2(self): return UVec2(self.x, self.y) argument
390 def toUVec3(self): return UVec3(self.x, self.y, 0.0) argument
391 def toUVec4(self): return UVec4(self.x, self.y, 0.0, 0.0) argument
392 def toMat2(self): return Mat2(float(self.x), 0.0, 0.0, float(self.y)); argument
394 def toFloat(self): return Vec2(float(self.x), float(self.y)) argument
395 def toInt(self): return Vec2(int(self.x), int(self.y)) argument
396 def toUint(self): return UVec2(int(self.x), int(self.y)) argument
397 def toBool(self): return Vec2(bool(self.x), bool(self.y)) argument
399 def getNumScalars(self): return 2 argument
400 def getScalars(self): return [self.x, self.y] argument
402 def typeString(self): argument
403 if isinstance(self.x, bool):
405 elif isinstance(self.x, int):
407 elif isinstance(self.x, float):
412 def vec4Swizzle(self): argument
415 def __str__(self): argument
416 if isinstance(self.x, bool):
417 return "bvec2(%s, %s)" % (str(self.x).lower(), str(self.y).lower())
418 elif isinstance(self.x, int):
419 return "ivec2(%i, %i)" % (self.x, self.y)
420 elif isinstance(self.x, float):
421 return "vec2(%s, %s)" % (self.x, self.y)
425 def distance(self, v): argument
427 return (self - v).length()
429 def dot(self, v): argument
431 return Scalar(self.x*v.x + self.y*v.y)
433 def abs(self): argument
434 if isinstance(self.x, bool):
435 return Vec2(self.x, self.y)
437 return Vec2(abs(self.x), abs(self.y))
439 def __neg__(self): argument
440 return Vec2(-self.x, -self.y)
442 def __add__(self, val): argument
444 return Vec2(self.x + val, self.y + val)
446 return Vec2(self.x + val.x, self.y + val.y)
450 def __sub__(self, val): argument
451 return self + (-val)
453 def __mul__(self, val): argument
457 return Vec2(self.x * val.x, self.y * val.y)
459 def __div__(self, val): argument
461 return Vec2(self.x / val.x, self.y / val.x)
464 return Vec2(self.x / val.x, self.y / val.y)
466 def boolAny(self): return Scalar(self.x or self.y) argument
467 def boolAll(self): return Scalar(self.x and self.y) argument
468 def boolNot(self): return Vec2(not self.x, not self.y) argument
471 def __init__(self, x, y): argument
474 Vec2.__init__(self, x, y)
476 def typeString(self): argument
479 def __str__(self): argument
480 return "uvec2(%i, %i)" % (self.x, self.y)
482 def abs(self): argument
483 return Vec2.abs(self).toUint()
486 def __init__(self, x, y, z): argument
488 self.x = x
489 self.y = y
490 self.z = z
492 def applyUnary(self, func): return Vec3(func(self.x), func(self.y), func(self.z)) argument
493 …def applyBinary(self, func, other): return Vec3(func(self.x, other.x), func(self.y, other.y), func… argument
495 def expandVec(self, val): return val.toVec3() argument
496 def toScalar(self): return Scalar(self.x) argument
497 def toVec2(self): return Vec2(self.x, self.y) argument
498 def toVec3(self): return Vec3(self.x, self.y, self.z) argument
499 def toVec4(self): return Vec4(self.x, self.y, self.z, 0.0) argument
500 def toUVec2(self): return UVec2(self.x, self.y) argument
501 def toUVec3(self): return UVec3(self.x, self.y, self.z) argument
502 def toUVec4(self): return UVec4(self.x, self.y, self.z, 0.0) argument
503 …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
505 def toFloat(self): return Vec3(float(self.x), float(self.y), float(self.z)) argument
506 def toInt(self): return Vec3(int(self.x), int(self.y), int(self.z)) argument
507 def toUint(self): return UVec3(int(self.x), int(self.y), int(self.z)) argument
508 def toBool(self): return Vec3(bool(self.x), bool(self.y), bool(self.z)) argument
510 def getNumScalars(self): return 3 argument
511 def getScalars(self): return [self.x, self.y, self.z] argument
513 def typeString(self): argument
514 if isinstance(self.x, bool):
516 elif isinstance(self.x, int):
518 elif isinstance(self.x, float):
523 def vec4Swizzle(self): argument
526 def __str__(self): argument
527 if isinstance(self.x, bool):
528 return "bvec3(%s, %s, %s)" % (str(self.x).lower(), str(self.y).lower(), str(self.z).lower())
529 elif isinstance(self.x, int):
530 return "ivec3(%i, %i, %i)" % (self.x, self.y, self.z)
531 elif isinstance(self.x, float):
532 return "vec3(%s, %s, %s)" % (self.x, self.y, self.z)
536 def distance(self, v): argument
538 return (self - v).length()
540 def dot(self, v): argument
542 return Scalar(self.x*v.x + self.y*v.y + self.z*v.z)
544 def cross(self, v): argument
546 return Vec3(self.y*v.z - v.y*self.z,
547 self.z*v.x - v.z*self.x,
548 self.x*v.y - v.x*self.y)
550 def abs(self): argument
551 if isinstance(self.x, bool):
552 return Vec3(self.x, self.y, self.z)
554 return Vec3(abs(self.x), abs(self.y), abs(self.z))
556 def __neg__(self): argument
557 return Vec3(-self.x, -self.y, -self.z)
559 def __add__(self, val): argument
561 return Vec3(self.x + val, self.y + val)
563 return Vec3(self.x + val.x, self.y + val.y, self.z + val.z)
567 def __sub__(self, val): argument
568 return self + (-val)
570 def __mul__(self, val): argument
574 return Vec3(self.x * val.x, self.y * val.y, self.z * val.z)
576 def __div__(self, val): argument
578 return Vec3(self.x / val.x, self.y / val.x, self.z / val.x)
580 return Vec3(self.x / val.x, self.y / val.y, self.z / val.z)
584 def boolAny(self): return Scalar(self.x or self.y or self.z) argument
585 def boolAll(self): return Scalar(self.x and self.y and self.z) argument
586 def boolNot(self): return Vec3(not self.x, not self.y, not self.z) argument
589 def __init__(self, x, y, z): argument
592 Vec3.__init__(self, x, y, z)
594 def typeString(self): argument
597 def __str__(self): argument
598 return "uvec3(%i, %i, %i)" % (self.x, self.y, self.z)
600 def abs(self): argument
601 return Vec3.abs(self).toUint()
604 def __init__(self, x, y, z, w): argument
606 self.x = x
607 self.y = y
608 self.z = z
609 self.w = w
611 def applyUnary(self, func): return Vec4(func(self.x), func(self.y), func(self.z), func(self.w)) argument
612 …def applyBinary(self, func, other): return Vec4(func(self.x, other.x), func(self.y, other.y), func… argument
614 def expandVec(self, val): return val.toVec4() argument
615 def toScalar(self): return Scalar(self.x) argument
616 def toVec2(self): return Vec2(self.x, self.y) argument
617 def toVec3(self): return Vec3(self.x, self.y, self.z) argument
618 def toVec4(self): return Vec4(self.x, self.y, self.z, self.w) argument
619 def toUVec2(self): return UVec2(self.x, self.y) argument
620 def toUVec3(self): return UVec3(self.x, self.y, self.z) argument
621 def toUVec4(self): return UVec4(self.x, self.y, self.z, self.w) argument
622 def toMat2(self): return Mat2(float(self.x), float(self.y), float(self.z), float(self.w)) argument
623 …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
625 def toFloat(self): return Vec4(float(self.x), float(self.y), float(self.z), float(self.w)) argument
626 def toInt(self): return Vec4(int(self.x), int(self.y), int(self.z), int(self.w)) argument
627 def toUint(self): return UVec4(int(self.x), int(self.y), int(self.z), int(self.w)) argument
628 def toBool(self): return Vec4(bool(self.x), bool(self.y), bool(self.z), bool(self.w)) argument
630 def getNumScalars(self): return 4 argument
631 def getScalars(self): return [self.x, self.y, self.z, self.w] argument
633 def typeString(self): argument
634 if isinstance(self.x, bool):
636 elif isinstance(self.x, int):
638 elif isinstance(self.x, float):
643 def vec4Swizzle(self): argument
646 def __str__(self): argument
647 if isinstance(self.x, bool):
648 …return "bvec4(%s, %s, %s, %s)" % (str(self.x).lower(), str(self.y).lower(), str(self.z).lower(), s…
649 elif isinstance(self.x, int):
650 return "ivec4(%i, %i, %i, %i)" % (self.x, self.y, self.z, self.w)
651 elif isinstance(self.x, float):
652 return "vec4(%s, %s, %s, %s)" % (self.x, self.y, self.z, self.w)
656 def distance(self, v): argument
658 return (self - v).length()
660 def dot(self, v): argument
662 return Scalar(self.x*v.x + self.y*v.y + self.z*v.z + self.w*v.w)
664 def abs(self): argument
665 if isinstance(self.x, bool):
666 return Vec4(self.x, self.y, self.z, self.w)
668 return Vec4(abs(self.x), abs(self.y), abs(self.z), abs(self.w))
670 def __neg__(self): argument
671 return Vec4(-self.x, -self.y, -self.z, -self.w)
673 def __add__(self, val): argument
675 return Vec3(self.x + val, self.y + val)
677 return Vec4(self.x + val.x, self.y + val.y, self.z + val.z, self.w + val.w)
681 def __sub__(self, val): argument
682 return self + (-val)
684 def __mul__(self, val): argument
688 return Vec4(self.x * val.x, self.y * val.y, self.z * val.z, self.w * val.w)
690 def __div__(self, val): argument
692 return Vec4(self.x / val.x, self.y / val.x, self.z / val.x, self.w / val.x)
694 return Vec4(self.x / val.x, self.y / val.y, self.z / val.z, self.w / val.w)
698 def boolAny(self): return Scalar(self.x or self.y or self.z or self.w) argument
699 def boolAll(self): return Scalar(self.x and self.y and self.z and self.w) argument
700 def boolNot(self): return Vec4(not self.x, not self.y, not self.z, not self.w) argument
703 def __init__(self, x, y, z, w): argument
706 Vec4.__init__(self, x, y, z, w)
708 def typeString(self): argument
711 def __str__(self): argument
712 return "uvec4(%i, %i, %i, %i)" % (self.x, self.y, self.z, self.w)
714 def abs(self): argument
715 return Vec4.abs(self).toUint()
719 def __init__ (self, numCols, numRows, scalars): argument
721 self.numCols = numCols
722 self.numRows = numRows
723 self.scalars = scalars
737 def get (self, colNdx, rowNdx): argument
738 assert 0 <= colNdx and colNdx < self.numCols
739 assert 0 <= rowNdx and rowNdx < self.numRows
740 return self.scalars[colNdx*self.numRows + rowNdx]
742 def set (self, colNdx, rowNdx, scalar): argument
743 assert 0 <= colNdx and colNdx < self.numCols
744 assert 0 <= rowNdx and rowNdx < self.numRows
745 self.scalars[colNdx*self.numRows + rowNdx] = scalar
747 def toMatrix (self, numCols, numRows): argument
749 for col in range(0, min(self.numCols, numCols)):
750 for row in range(0, min(self.numRows, numRows)):
751 res.set(col, row, self.get(col, row))
754 def toMat2 (self): return self.toMatrix(2, 2) argument
755 def toMat2x3 (self): return self.toMatrix(2, 3) argument
756 def toMat2x4 (self): return self.toMatrix(2, 4) argument
757 def toMat3x2 (self): return self.toMatrix(3, 2) argument
758 def toMat3 (self): return self.toMatrix(3, 3) argument
759 def toMat3x4 (self): return self.toMatrix(3, 4) argument
760 def toMat4x2 (self): return self.toMatrix(4, 2) argument
761 def toMat4x3 (self): return self.toMatrix(4, 3) argument
762 def toMat4 (self): return self.toMatrix(4, 4) argument
764 def typeString(self): argument
765 if self.numRows == self.numCols:
766 return "mat%d" % self.numRows
768 return "mat%dx%d" % (self.numCols, self.numRows)
770 def __str__(self): argument
771 return "%s(%s)" % (self.typeString(), ", ".join(["%s" % s for s in self.scalars]))
773 def isTypeEqual (self, other): argument
774 return isinstance(other, Mat) and self.numRows == other.numRows and self.numCols == other.numCols
776 def isEqual(self, other): argument
777 assert self.isTypeEqual(other)
778 return (self.scalars == other.scalars)
780 def compMul(self, val): argument
781 assert self.isTypeEqual(val)
782 …return Mat(self.numRows, self.numCols, [self.scalars(i) * val.scalars(i) for i in range(self.numRo…
785 def __init__(self, m00, m01, m10, m11): argument
786 Mat.__init__(self, 2, 2, [m00, m10, m01, m11])
789 def __init__(self, m00, m01, m02, m10, m11, m12, m20, m21, m22): argument
790 Mat.__init__(self, 3, 3, [m00, m10, m20,
795 def __init__(self, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33): argument
796 Mat.__init__(self, 4, 4, [m00, m10, m20, m30,