Clarisse 4.0 SP9 SDK  4.0.0.0.9
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
GMathTransform Class Reference
Inheritance diagram for GMathTransform:
CoreBaseType

Public Member Functions

 GMathTransform (const GMathVec3d &t, const GMathVec3d &r, const GMathVec3d &sh, const GMathVec3d &s, const GMathVec3d &to, const GMathVec3d &ro, const GMathVec3d &so, const GMathVec3d &rp, const GMathVec3d &sp, const GMathVec3d &rpo, const GMathVec3d &spo, const GMathRotationOrder &r_order, const GMathRotationOrder &ro_order)
 
void compute_kinematic_matrix (GMathMatrix4x4d &m) const
 Compute the kinematic matrix.
 
void compute_inverse_kinematic_matrix (GMathMatrix4x4d &m) const
 Compute the inverse kinematic matrix.
 
void compute_global_matrix (GMathMatrix4x4d &m) const
 Compute the global matrix using the pivots information.
 
void compute_inverse_global_matrix (GMathMatrix4x4d &m) const
 Compute the inverse global matrix.
 
void compute_global_rotation_pivot (GMathVec3d &p) const
 Compute the global position of the rotation pivot.
 
void compute_global_scaling_pivot (GMathVec3d &p) const
 Compute the global position of the scaling pivot.
 
void compute_global_rotation_pivot_matrix (GMathMatrix4x4d &m) const
 Compute the global matrix of the rotation pivot.
 
void compute_global_scaling_pivot_matrix (GMathMatrix4x4d &m) const
 Compute the global matrix of the scaling pivot.
 
void set_global_matrix (const GMathMatrix4x4d &m)
 Set translation, rotation, shearing and scaling by extracting their values from the given matrix and reset all other parameters.
 
void inplace_set_translation (const GMathVec3d &t)
 Set the translation without changing the global matrix.
 
void inplace_set_rotation (const GMathVec3d &r)
 Set the rotation without changing the global matrix.
 
void inplace_set_rotation (const GMathMatrix4x4d &rm)
 Set the rotation without changing the global matrix.
 
void inplace_set_scaling (const GMathVec3d &s)
 Set the scaling without changing the global matrix.
 
void inplace_set_translation_offset (const GMathVec3d &to)
 Set the translation offset without changing the global matrix.
 
void inplace_set_rotation_offset (const GMathVec3d &ro)
 Set the rotation offset without changing the global matrix.
 
void inplace_set_rotation_offset (const GMathMatrix4x4d &rom)
 Set the rotation offset without changing the global matrix.
 
void inplace_set_scaling_offset (const GMathVec3d &so)
 Set the scaling offset without changing the global matrix.
 
void inplace_set_rotation_pivot (const GMathVec3d &p)
 Set the rotation pivot without changing the global matrix.
 
void inplace_set_scaling_pivot (const GMathVec3d &p)
 Set the scaling pivot without changing the global matrix.
 
void inplace_set_global_rotation_pivot (const GMathVec3d &p)
 Set the global position of the rotation pivot without changing the global matrix.
 
void inplace_set_global_scaling_pivot (const GMathVec3d &p)
 Set the global position of the scaling pivot without changing the global matrix.
 
void inplace_set_global_rotation_pivot_with_care (const GMathVec3d &p, short locked_dims=0)
 Set the global position of the rotation pivot without changing the global matrix.
 
void inplace_set_global_scaling_pivot_with_care (const GMathVec3d &p, short locked_dims=0)
 Set the global position of the scaling pivot without changing the global matrix.
 
void inplace_reset_rotation_pivot ()
 Reset the rotation pivot and its offset without changing the global matrix.
 
void inplace_reset_scaling_pivot ()
 Reset the scaling pivot and its offset without changing the global matrix.
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 
bool operator== (const CoreBaseType &obj) const
 

Static Public Member Functions

static GMathVec3d transform_translation (const GMathVec3d &t, const GMathMatrix4x4d &xform)
 
static GMathMatrix4x4d transform_rotation (const GMathMatrix4x4d &rm, const GMathMatrix4x4d &xform)
 
static GMathVec3d transform_rotation (const GMathVec3d &r, const GMathRotationOrder &order, const GMathMatrix4x4d &xform)
 
static GMathVec3d transform_scaling (const GMathVec3d &s, const GMathMatrix4x4d &xform)
 
static GMathVec3d transform_shearing (const GMathVec3d &sh, const GMathMatrix4x4d &xform)
 
static void interpolate (GMathTransform &result, const GMathTransform &t0, const GMathTransform &t1, const double &weight)
 Interpolate two transforms.
 
static void interpolate (GMathMatrix4x4d &result, const GMathTransform &t0, const GMathTransform &t1, const double &weight)
 Interpolate two transforms and return the corresponding global matrix.
 
- Static Public Member Functions inherited from CoreBaseType
static bool ___class_destructor__ (void *instance, const bool &is_array)
 
static const CoreClassInfoclass_info ()
 

Public Attributes

GMathVec3d translation
 
GMathVec3d rotation
 
GMathVec3d shearing
 
GMathVec3d scaling
 
GMathVec3d translation_offset
 
GMathVec3d rotation_offset
 
GMathVec3d scaling_offset
 
GMathVec3d rotation_pivot
 
GMathVec3d scaling_pivot
 
GMathVec3d rotation_pivot_offset
 
GMathVec3d scaling_pivot_offset
 
GMathRotationOrder rotation_order
 
GMathRotationOrder rotation_offset_order
 

Member Function Documentation

void GMathTransform::compute_global_matrix ( GMathMatrix4x4d &  m) const

Compute the global matrix using the pivots information.

Parameters
mthe resulting matrix

The global matrix is computed with the following formula: G = T.To.Rt.Rp.R.Ro.(Rp^-1).St.Sp.Sh.S.So.(Sp^-1) T, R, Sh, S: translation, rotation, shearing, scaling To, Ro, So: translation, rotation, scaling offsets Rp = position of the rotation pivot Sp = position of the scaling pivot Rt = translation offset of the rotation pivot St = translation offset of the scaling pivot

void GMathTransform::compute_global_rotation_pivot ( GMathVec3d &  p) const

Compute the global position of the rotation pivot.

Parameters
pthe resulting position
void GMathTransform::compute_global_rotation_pivot_matrix ( GMathMatrix4x4d &  m) const

Compute the global matrix of the rotation pivot.

Parameters
mthe resulting matrix
void GMathTransform::compute_global_scaling_pivot ( GMathVec3d &  p) const

Compute the global position of the scaling pivot.

Parameters
pthe resulting position
void GMathTransform::compute_global_scaling_pivot_matrix ( GMathMatrix4x4d &  m) const

Compute the global matrix of the scaling pivot.

Parameters
mthe resulting matrix
void GMathTransform::compute_inverse_global_matrix ( GMathMatrix4x4d &  m) const

Compute the inverse global matrix.

Parameters
mthe resulting matrix
void GMathTransform::compute_inverse_kinematic_matrix ( GMathMatrix4x4d &  m) const

Compute the inverse kinematic matrix.

Parameters
mthe resulting matrix
void GMathTransform::compute_kinematic_matrix ( GMathMatrix4x4d &  m) const

Compute the kinematic matrix.

Parameters
mthe resulting matrix

The kinematic matrix is computed with the following formula: K = T.R.Sh.S T, R, Sh, S: translation, rotation, shearing, scaling

void GMathTransform::inplace_reset_rotation_pivot ( )

Reset the rotation pivot and its offset without changing the global matrix.

Input: rotation, translation_offset, rotation_offset, rotation_pivot, rotation_pivot_offset, rotation_order, rotation_offset_order Output: translation_offset, rotation_pivot, rotation_pivot_offset

void GMathTransform::inplace_reset_scaling_pivot ( )

Reset the scaling pivot and its offset without changing the global matrix.

Input: rotation, shearing, scaling, translation_offset, rotation_offset, scaling_offset, scaling_pivot, scaling_pivot_offset, rotation_order, rotation_offset_order Output: translation_offset, scaling_pivot, scaling_pivot_offset

void GMathTransform::inplace_set_global_rotation_pivot ( const GMathVec3d &  p)

Set the global position of the rotation pivot without changing the global matrix.

Parameters
pthe new global position for the rotation pivot

Input: translation, rotation, translation_offset, rotation_offset, rotation_pivot, rotation_pivot_offset, rotation_order, rotation_offset_order Output: rotation_pivot, rotation_pivot_offset

void GMathTransform::inplace_set_global_rotation_pivot_with_care ( const GMathVec3d &  p,
short  locked_dims = 0 
)

Set the global position of the rotation pivot without changing the global matrix.

Parameters
pthe new global position for the rotation pivot
locked_dimsconsider which dimension(s) should be kept unchanged. Default value is 0. Value is build as 1<<0(x) | 1<<1(y) | 1<<2(z), multiple locks are handled with |.

Input: translation, rotation, translation_offset, rotation_offset, rotation_pivot, rotation_pivot_offset, rotation_order, rotation_offset_order Output: rotation_pivot, rotation_pivot_offset

void GMathTransform::inplace_set_global_scaling_pivot ( const GMathVec3d &  p)

Set the global position of the scaling pivot without changing the global matrix.

Parameters
pthe new global position for the scaling pivot

Input: translation, rotation, shearing, scaling, translation_offset, rotation_offset, scaling_offset, rotation_pivot, scaling_pivot, rotation_pivot_offset, scaling_pivot_offset, rotation_order, rotation_offset_order Output: scaling_pivot, scaling_pivot_offset

void GMathTransform::inplace_set_global_scaling_pivot_with_care ( const GMathVec3d &  p,
short  locked_dims = 0 
)

Set the global position of the scaling pivot without changing the global matrix.

Parameters
pthe new global position for the scaling pivot
locked_dimsconsider which dimension(s) should be kept unchanged. Default value is 0. Value is build as 1<<0(x) | 1<<1(y) | 1<<2(z), multiple locks are handled with |.

Input: translation, rotation, shearing, scaling, translation_offset, rotation_offset, scaling_offset, rotation_pivot, scaling_pivot, rotation_pivot_offset, scaling_pivot_offset, rotation_order, rotation_offset_order Output: scaling_pivot, scaling_pivot_offset

void GMathTransform::inplace_set_rotation ( const GMathVec3d &  r)

Set the rotation without changing the global matrix.

Parameters
rthe new rotation

Input: rotation, rotation_offset, rotation_order, rotation_offset_order Output: rotation, rotation_offset

void GMathTransform::inplace_set_rotation ( const GMathMatrix4x4d &  rm)

Set the rotation without changing the global matrix.

Parameters
rmthe new rotation matrix

Input: rotation, rotation_offset, rotation_order, rotation_offset_order Output: rotation, rotation_offset

void GMathTransform::inplace_set_rotation_offset ( const GMathVec3d &  ro)

Set the rotation offset without changing the global matrix.

Parameters
rothe new rotation offset

Input: rotation, rotation_offset, rotation_order, rotation_offset_order Output: rotation, rotation_offset

void GMathTransform::inplace_set_rotation_offset ( const GMathMatrix4x4d &  rom)

Set the rotation offset without changing the global matrix.

Parameters
romthe new rotation offset matrix

Input: rotation, rotation_offset, rotation_order, rotation_offset_order Output: rotation, rotation_offset

void GMathTransform::inplace_set_rotation_pivot ( const GMathVec3d &  p)

Set the rotation pivot without changing the global matrix.

Parameters
pthe new rotation pivot

Input: rotation, rotation_offset, rotation_pivot, rotation_pivot_offset, rotation_order, rotation_offset_order Output: rotation_pivot, rotation_pivot_offset

void GMathTransform::inplace_set_scaling ( const GMathVec3d &  s)

Set the scaling without changing the global matrix.

Parameters
sthe new scaling

Input: scaling, scaling_offset Output: scaling, scaling_offset

void GMathTransform::inplace_set_scaling_offset ( const GMathVec3d &  so)

Set the scaling offset without changing the global matrix.

Parameters
sothe new scaling offset

Input: scaling, scaling_offset Output: scaling, scaling_offset

void GMathTransform::inplace_set_scaling_pivot ( const GMathVec3d &  p)

Set the scaling pivot without changing the global matrix.

Parameters
pthe new scaling pivot

Input: shearing, scaling, scaling_offset, scaling_pivot, scaling_pivot_offset Output: scaling_pivot, scaling_pivot_offset

void GMathTransform::inplace_set_translation ( const GMathVec3d &  t)

Set the translation without changing the global matrix.

Parameters
tthe new translation

Input: translation, translation_offset Output: translation, translation_offset

void GMathTransform::inplace_set_translation_offset ( const GMathVec3d &  to)

Set the translation offset without changing the global matrix.

Parameters
tothe new translation offset

Input: translation, translation_offset Output: translation, translation_offset

void GMathTransform::interpolate ( GMathTransform result,
const GMathTransform t0,
const GMathTransform t1,
const double &  weight1 
)
static

Interpolate two transforms.

Parameters
[out]resultthe resulting transform
[in]t0the first input transform
[in]t1the second input transform
[in]weighta weight between 0 and 1
void GMathTransform::interpolate ( GMathMatrix4x4d &  result,
const GMathTransform t0,
const GMathTransform t1,
const double &  weight1 
)
static

Interpolate two transforms and return the corresponding global matrix.

Parameters
[out]resultthe resulting global matrix
[in]t0the first input transform
[in]t1the second input transform
[in]weighta weight between 0 and 1
void GMathTransform::set_global_matrix ( const GMathMatrix4x4d &  m)

Set translation, rotation, shearing and scaling by extracting their values from the given matrix and reset all other parameters.

Parameters
mmatrix from which to extract values