transform¶
-
class
guerilla.transform¶ Bases:
objectA transform is a set of matrices placed in time at inter-frames
-
addmatrix(source, time)¶ Add a matrix and its time at the end of the transform
Parameters: - source (
matrix) – the matrix to add - time (number) – the time associated
- source (
-
compose(right)¶ Right compose by another transform. The result may be inccaurate if the final number of matrices is above 6.
Parameters: right ( transform) – the transform to compose on the right
-
copy(*args)¶ copy a transform into this transform
Available arguments:
Parameters: source ( transform) – the source transformReturn type: transformor
Parameters: source ( matrix) – the source matrixReturn type: transform
-
createcompose(first, second)¶ Create the compose transform of first times second
Parameters: Return type:
-
getmatrix(index)¶ return the nth matrix of the transform
Parameters: index (int) – Matrix number to return Return type: matrix
-
getnormalized()¶ Compute the normalized transform
Returns: The resulting normalized transform Return type: transform
-
getstepcount()¶ Return the number of steps in this transform
-
gettime(index)¶ Get the transform time at index
Parameters: index (int) – the index in the transform Return type: number
-
invert()¶ Invert the transform
-
isidentity()¶ Returns true if the transform is identity
Returns: True when the transform is identity Return type: bool
-
serialstring()¶ Returns a Lua evaluable string to create this object
-
setmatrix(index, source)¶ Set the matrix by its index
Parameters:
-
setscale(scale)¶ Force the scale of the transform
Parameters: scale ( point3or number) – the scale factor to apply
-
setscaleafter(scale)¶ Force the scale of the transform after the rotation component of the transform
Parameters: scale ( point3or number) – the scale factor to apply
-
settime(index, time)¶ Set the transform time at index
Parameters: - index (int) – the index in the transform
- time (number) – the time to set
-
symetric(*args)¶ Compute the symetric of this transform by a plane defined by a point and a normal vector
Available arguments:
Parameters: Returns: The resulting symetric transform
Return type: or
Parameters: Returns: The resulting symetric transform
Return type:
-
transform(source, func)¶ Copy the transform and apply a function on each matrix of the copy.
This method copies the transform and apply a user function on each of the matrices of the copied transform. The user function takes one matrix as argument, and modifies directly this matrix.
Parameters: - source (
transform) – the transform to transform - func (function) – the user function to apply on each matrix of the transform
Returns: The resulting transform
Return type: - source (
-