Package xode :: Module transform :: Class Transform
[show private | hide private]
[frames | no frames]

Class Transform


A matrix transform.
Method Summary
  __init__(self)
Initialise as an identity transform.
  __mul__(self, t2)
Concatenate this transform with another.
tuple getPosition(self)
Extracts the position vector.
tuple getRotation(self)
Extracts the rotation matrix.
bool isAbsolute(self)
Return true if this transform is to be absolute rather than relative to another.
  rotate(self, x, y, z)
Set the matrix to rotate a point.
  scale(self, x, y, z)
Set the matrix to scale a point.
  setIdentity(self)
Set the matrix so that there is no translation, rotation or scaling.
  takeParser(self, parser, node, attrs)
Called to make this object handle further parsing.
  translate(self, x, y, z)
Set the matrix to translate a point.

Method Details

__init__(self)
(Constructor)

Initialise as an identity transform.

__mul__(self, t2)

Concatenate this transform with another.
Parameters:
t2 - The second transform.
           (type=instance of Transform)

getPosition(self)

Extracts the position vector. It is returned as a tuple in the form (x, y, z).
Returns:
The position vector.
           (type=tuple)

getRotation(self)

Extracts the rotation matrix. It is returned as a tuple in the form (m00, m01, m02, m10, m11, m12, m20, m21, m22).
Returns:
The rotation matrix.
           (type=tuple)

isAbsolute(self)

Returns:
True if this transform is to be absolute rather than relative to another.
           (type=bool)

rotate(self, x, y, z)

Set the matrix to rotate a point.
Parameters:
x - Rotation around the x axis in radians.
           (type=float)
y - Rotation around the y axis in radians.
           (type=float)
z - Rotation around the z axis in radians.
           (type=float)

scale(self, x, y, z)

Set the matrix to scale a point.
Parameters:
x - The scaling factor along the x axis.
           (type=float)
y - The scaling factor along the y axis.
           (type=float)
z - The scaling factor along the z axis.
           (type=float)

setIdentity(self)

Set the matrix so that there is no translation, rotation or scaling.

takeParser(self, parser, node, attrs)

Called to make this object handle further parsing. It should be called immediately after the <transform> tag has been encountered.
Parameters:
parser - The parser.
           (type=instance of parser.Parser)
node - The node that is to be transformed.
           (type=instance of node.TreeNode)
attrs - The <transform> tag attributes.
           (type=dict)

translate(self, x, y, z)

Set the matrix to translate a point.
Parameters:
x - The offset along the x axis.
           (type=float)
y - The offset along the y axis.
           (type=float)
z - The offset along the z axis.
           (type=float)

Generated by Epydoc 2.1 on Sun Feb 4 17:54:12 2007 http://epydoc.sf.net