~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/python/api2_2x/doc/Mathutils.py

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
  @param low: The lower range.
40
40
  """
41
41
 
42
 
def Vector (list = None):
43
 
  """
44
 
  Create a new Vector object from a list.
45
 
  @type list: PyList of float or int
46
 
  @param list: The list of values for the Vector object.
47
 
  Must be 2, 3, or 4 values.
48
 
  @rtype: Vector object.
49
 
  @return: It depends wheter a parameter was passed:
50
 
      - (list): Vector object initialized with the given values;
51
 
      - ():     An empty 3 dimensional vector.
52
 
  """
53
 
 
54
42
def CopyVec(vector):
55
43
  """
56
44
  Create a copy of the Vector object.
128
116
  @return: The parallel projection vector.
129
117
  """
130
118
 
131
 
def Matrix(list1 = None, list2 = None, list3 = None, list4 = None):
132
 
  """  
133
 
  Create a new matrix object from intialized values.
134
 
  @type list1: PyList of int/float
135
 
  @param list1: A 2d,3d or 4d list.
136
 
  @type list2: PyList of int/float
137
 
  @param list2: A 2d,3d or 4d list.
138
 
  @type list3: PyList of int/float
139
 
  @param list3: A 2d,3d or 4d list.
140
 
  @type list4: PyList of int/float
141
 
  @param list4: A 2d,3d or 4d list.
142
 
  @rtype: New matrix object.
143
 
  @return: It depends wheter a parameter was passed:
144
 
      - (list1, etc.): Matrix object initialized with the given values;
145
 
      - ():     An empty 3 dimensional matrix.
146
 
  """
147
 
 
148
119
def RotationMatrix(angle, matSize, axisFlag, axis):
149
120
  """  
150
121
  Create a matrix representing a rotation.
248
219
  @return: The column vector that results from the muliplication.
249
220
  """
250
221
 
251
 
def Quaternion(list = None, angle = None):
252
 
  """  
253
 
  Create a new matrix object from intialized values.
254
 
  @type list: PyList of int/float
255
 
  @param list: A 3d or 4d list to intialize quaternion.
256
 
  4d if intializing, 3d if will be used as an axis of rotation.
257
 
  @type angle: float (optional)
258
 
  @param angle: An arbitrary rotation amount around 'list'.
259
 
  List is used as an axis of rotation in this case.
260
 
  @rtype: New quaternion object.
261
 
  @return: It depends wheter a parameter was passed:
262
 
      - (list/angle): Quaternion object initialized with the given values;
263
 
      - ():     An identity 4 dimensional quaternion.
264
 
  """
265
 
 
266
222
def CopyQuat(quaternion):
267
223
  """
268
224
  Create a copy of the Quaternion object.
320
276
  @return: The interpolated rotation.
321
277
  """
322
278
 
323
 
def Euler(list = None):
324
 
  """
325
 
  Create a new euler object.
326
 
  @type list: PyList of float/int
327
 
  @param list: 3d list to initalize euler
328
 
  @rtype: Euler object
329
 
  @return: Euler representing heading, pitch, bank.
330
 
  Values are in degrees.
331
 
  """
332
 
 
333
279
def CopyEuler(euler):
334
280
  """
335
281
  Create a new euler object.
358
304
  The Vector object
359
305
  =================
360
306
    This object gives access to Vectors in Blender.
361
 
  @cvar x: The x value.
362
 
  @cvar y: The y value.
363
 
  @cvar z: The z value (if any).
364
 
  @cvar w: The w value (if any).
365
 
  @cvar length: The magnitude of the vector.
 
307
  @ivar x: The x value.
 
308
  @ivar y: The y value.
 
309
  @ivar z: The z value (if any).
 
310
  @ivar w: The w value (if any).
 
311
  @ivar length: The magnitude of the vector.
366
312
  """
367
313
 
 
314
  def __init__(list = None):
 
315
    """
 
316
    Create a new Vector object from a list.
 
317
 
 
318
    Example::
 
319
      v = Blender.Mathutils.Vector([1,0,0])
 
320
    @type list: PyList of float or int
 
321
    @param list: The list of values for the Vector object.
 
322
    Must be 2, 3, or 4 values. The list is mapped to the parameters as [x,y,z,w].
 
323
    @rtype: Vector object.
 
324
    @return: It depends wheter a parameter was passed:
 
325
        - (list): Vector object initialized with the given values;
 
326
        - ():     An empty 3 dimensional vector.
 
327
    """
 
328
 
368
329
  def zero():
369
330
    """
370
331
    Set all values to zero.
400
361
  The Euler object
401
362
  ================
402
363
    This object gives access to Eulers in Blender.
403
 
  @cvar x: The heading value in degrees.
404
 
  @cvar y: The pitch value in degrees.
405
 
  @cvar z: The roll value in degrees.
 
364
  @ivar x: The heading value in degrees.
 
365
  @ivar y: The pitch value in degrees.
 
366
  @ivar z: The roll value in degrees.
406
367
  """
407
368
 
 
369
  def __init__(list = None):
 
370
    """
 
371
    Create a new euler object.
 
372
 
 
373
    Example::
 
374
      euler = Euler([45,0,0])
 
375
    @type list: PyList of float/int
 
376
    @param list: 3d list to initialize euler
 
377
    @rtype: Euler object
 
378
    @return: Euler representing heading, pitch, bank.
 
379
    @note: Values are in degrees.
 
380
    """
 
381
 
408
382
  def zero():
409
383
    """
410
384
    Set all values to zero.
436
410
  The Quaternion object
437
411
  =====================
438
412
    This object gives access to Quaternions in Blender.
439
 
  @cvar w: The w value.
440
 
  @cvar x: The x value.
441
 
  @cvar y: The y value.
442
 
  @cvar z: The z value.
443
 
  @cvar magnitude: The magnitude of the quaternion.
444
 
  @cvar axis: Vector representing the axis of rotation.
445
 
  @cvar angle: A scalar representing the amount of rotation
 
413
  @ivar w: The w value.
 
414
  @ivar x: The x value.
 
415
  @ivar y: The y value.
 
416
  @ivar z: The z value.
 
417
  @ivar magnitude: The magnitude of the quaternion.
 
418
  @ivar axis: Vector representing the axis of rotation.
 
419
  @ivar angle: A scalar representing the amount of rotation
446
420
  in degrees.
447
421
  """
448
422
 
 
423
  def __init__(list, angle = None):
 
424
    """  
 
425
    Create a new quaternion object from initialized values.
 
426
 
 
427
    Example::
 
428
      quat = Mathutils.Quaternion([1.0,0.0,0.0])
 
429
 
 
430
    @type list: PyList of int/float
 
431
    @param list: A 3d or 4d list to initialize quaternion.
 
432
        4d if intializing [w,x,y,z], 3d if used as an axis of rotation.
 
433
    @type angle: float (optional)
 
434
    @param angle: An arbitrary rotation amount around 'list'.
 
435
        List is used as an axis of rotation in this case.
 
436
    @rtype: New quaternion object.
 
437
    @return: It depends wheter a parameter was passed:
 
438
        - (list/angle): Quaternion object initialized with the given values;
 
439
        - ():     An identity 4 dimensional quaternion.
 
440
    """
 
441
 
449
442
  def identity():
450
443
    """
451
444
    Set the quaternion to the identity quaternion.
492
485
  The Matrix Object
493
486
  =================
494
487
    This object gives access to Matrices in Blender.
495
 
  @cvar rowsize: The row size of the matrix.
496
 
  @cvar colsize: The column size of the matrix.
 
488
  @ivar rowsize: The row size of the matrix.
 
489
  @ivar colsize: The column size of the matrix.
497
490
  """
498
491
 
 
492
  def __init__(list1 = None, list2 = None, list3 = None, list4 = None):
 
493
    """  
 
494
    Create a new matrix object from initialized values.
 
495
 
 
496
    Example::
 
497
      matrix = Mathutils.Matrix([1,1,1],[0,1,0],[1,0,0])
 
498
 
 
499
    @type list1: PyList of int/float
 
500
    @param list1: A 2d,3d or 4d list.
 
501
    @type list2: PyList of int/float
 
502
    @param list2: A 2d,3d or 4d list.
 
503
    @type list3: PyList of int/float
 
504
    @param list3: A 2d,3d or 4d list.
 
505
    @type list4: PyList of int/float
 
506
    @param list4: A 2d,3d or 4d list.
 
507
    @rtype: New matrix object.
 
508
    @return: It depends wheter a parameter was passed:
 
509
        - (list1, etc.): Matrix object initialized with the given values;
 
510
        - ():     An empty 3 dimensional matrix.
 
511
    """
 
512
 
499
513
  def zero():
500
514
    """
501
515
    Set all matrix values to 0.
513
527
 
514
528
  def determinant():
515
529
    """
516
 
    Return a the determinant of a matrix.
 
530
    Return the determinant of a matrix.
517
531
    @rtype: int
518
532
    @return: Return a the determinant of a matrix.
519
533
 
520
534
    """
521
535
 
522
 
  def inverse():
 
536
  def invert():
523
537
    """
524
538
    Set the matrix to it's inverse.
525
539
    """
526
540
 
527
541
  def rotationPart():
528
542
    """
529
 
    Return the 3d rotation matrix.
 
543
    Return the 3d submatrix corresponding to the linear term of the 
 
544
    embedded affine transformation in 3d. This matrix represents rotation
 
545
    and scale. Note that the (4,4) element of a matrix can be used for uniform
 
546
    scaling, too.
530
547
    @rtype: Matrix object.
531
 
    @return: Return the 3d rotation matrix.
 
548
    @return: Return the 3d matrix for rotation and scale.
532
549
 
533
550
    """
534
551
 
547
564
  
548
565
  def toEuler():
549
566
    """
550
 
    Return a euler representing the rotation matrix.
 
567
    Return an Euler representation of the rotation matrix.
551
568
    @rtype: Euler object
552
 
    @return: Return a euler representing the rotation matrix.
 
569
    @return: Euler representation of the rotation matrix.
553
570
 
554
571
    """
555
572
 
556
573
  def toQuat():
557
574
    """
558
 
    Return a quaternion representation the rotation matrix
 
575
    Return a quaternion representation of the rotation matrix
559
576
    @rtype: Quaternion object
560
 
    @return: Quaternion representation the rotation matrix
 
577
    @return: Quaternion representation of the rotation matrix
561
578
 
562
579
    """
563
580