transformΒΆ

class transform

A transform is a set of matrices placed in time at inter-frames

Members

Constructors:

transform result create ( ) create an uninitialised transform
transform result create ( boolean identity ) create a transform optionally set to identity
transform result create ( matrix m ) create a transform initialised to the matrix
transform result create ( transform t ) create a copy of the source transform

Methods:

nil addmatrix ( matrix source , number time ) Add a matrix and its time at the end of the transform
nil compose ( transform right ) Right compose by another transform. The result may be inccaurate if the final number of matrices is above 6.
transform result copy ( transform source ) copy a transform into this transform
transform result copy ( matrix source ) copy a a matrix into this transform as a single matrix
transform result createcompose ( matrix|transform first , matrix|transform second ) Create the compose transform of first times second
transform inverse createinverted ( ) Create the transform inserse
matrix result getmatrix ( int index ) return the nth matrix of the transform
nil getstepcount ( ) Return the number of steps in this transform
number result gettime ( integer index ) Get the transform time at index
matrix mtx interpolate ( float t )
nil invert ( ) Invert the transform
bool identity isidentity ( ) Returns true if the transform is identity
nil serialstring ( ) Returns a Lua evaluable string to create this object
nil setmatrix ( integer index , matrix source ) Set the matrix by its index
nil setscale ( point3|number scale ) Force the scale of the transform
nil setscaleafter ( point3|number scale ) Force the scale of the transform after the rotation component of the transform
nil settime ( integer index , number time ) Set the transform time at index
transform symetric symetric ( transform s , string axis ) Compute the symetric of this transform by a plane defined by another transform's position and axis
transform symetric symetric ( point3 P , point3 u ) Compute the symetric of this transform by a plane defined by a point and a normal vector
transform result transform ( transform source , function func ) Copy the transform and apply a function on each matrix of the copy.
nil translate ( point3 translation ) Translate a transform, all matrices are translated

Documentation

nil addmatrix ( matrix source , number time )

Add a matrix and its time at the end of the transform

Arguments:

  • source the matrix to add
  • time the time associated


nil compose ( transform right )

Right compose by another transform. The result may be inccaurate if the final number of matrices is above 6.

Arguments:

  • right the transform to compose on the right


transform result copy ( transform source )

copy a transform into this transform

Arguments:

  • source the source transform

Return:

  • result


transform result copy ( matrix source )

copy a a matrix into this transform as a single matrix

Arguments:

  • source the source matrix

Return:

  • result


transform result createcompose ( matrix|transform first , matrix|transform second )

Create the compose transform of first times second

Arguments:

  • first the first matrix|transform
  • second the second matrix|transform

Return:

  • result


transform inverse createinverted ( )

Create the transform inserse

Return:

  • inverse


matrix result getmatrix ( int index )

return the nth matrix of the transform

Arguments:

  • index Matrix number to return

Return:

  • result


nil getstepcount ( )

Return the number of steps in this transform


number result gettime ( integer index )

Get the transform time at index

Arguments:

  • index the index in the transform

Return:

  • result


matrix mtx interpolate ( float t )

Arguments:

  • t The time of the inbetween matrix (0 ~ 1)

Return:

  • mtx The resulting interpolated matrix


nil invert ( )

Invert the transform


bool identity isidentity ( )

Returns true if the transform is identity

Return:

  • identity True when the transform is identity


nil serialstring ( )

Returns a Lua evaluable string to create this object


nil setmatrix ( integer index , matrix source )

Set the matrix by its index

Arguments:

  • index the index in the transform
  • source the matrix to set


nil setscale ( point3|number scale )

Force the scale of the transform

Arguments:

  • scale the scale factor to apply


nil setscaleafter ( point3|number scale )

Force the scale of the transform after the rotation component of the transform

Arguments:

  • scale the scale factor to apply


nil settime ( integer index , number time )

Set the transform time at index

Arguments:

  • index the index in the transform
  • time the time to set


transform symetric symetric ( transform s , string axis )

Compute the symetric of this transform by a plane defined by another transform's position and axis

Arguments:

  • s The symetry plane tranform
  • axis The axis of the symetry transform to use as symetry plane normal ("x", "y" or "z")

Return:

  • symetric The resulting symetric transform


transform symetric symetric ( point3 P , point3 u )

Compute the symetric of this transform by a plane defined by a point and a normal vector

Arguments:

  • P The symetry plane point
  • u The symetry plane normal vector

Return:

  • symetric The resulting symetric transform


transform result transform ( transform source , function 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.
Arguments:

  • source the transform to transform
  • func the user function to apply on each matrix of the transform

Return:

  • result The resulting transform


nil translate ( point3 translation )

Translate a transform, all matrices are translated

Arguments:

  • translation the translation