class MPxIkSolver

Jump to documentation

OBSOLETE CLASS: Base class for user defined IK solvers (OpenMayaAnim)

public members:

virtual ~MPxIkSolver ()
static void registerSolver ( const MString & solverName, MCreatorFunction creatorFunction )
virtual MStatus preSolve ()
virtual MStatus doSolve ()
virtual MStatus postSolve ( MStatus )
virtual MString solverTypeName () const
virtual bool isSingleChainOnly () const
virtual bool isPositionOnly () const
virtual bool hasJointLimitSupport () const
virtual bool hasUniqueSolution () const
virtual bool groupHandlesByTopology () const
virtual MStatus setFuncValueTolerance ( double tolerance )
virtual MStatus setMaxIterations ( int value )
MIkHandleGroup * handleGroup () const
virtual void setHandleGroup ( MIkHandleGroup * )
const MMatrix * toWorldSpace () const
const MMatrix * toSolverSpace () const
double funcValueTolerance () const
int maxIterations () const
virtual void snapHandle ( MObject & handle )

protected members:

MStatus getJointAngles ( MDoubleArray & ) const
MStatus setJointAngles ( const MDoubleArray & )
void setToRestAngles ()
MPxIkSolver ()

Documentation

MPxIkSolver is OBSOLETE, and will be removed in a future version of Maya. The MPxIkSolver class has been replaced with the MPxIkSolverNode class. This is an obsolete base class for writing user-defined IK solvers.

Description

MPxIkSolver is OBSOLETE, and will be removed in a future version of Maya. The MPxIkSolver class has been replaced with the MPxIkSolverNode class.

This is the obsolete base class for writing user-defined IK solvers.
Users must at least override the following methods in order to write a solver:

To register a solver, write a creator method to return an instance of the user solver:

    userSolver::creator() {
        return new userSolver;
    }
    

The solver can then be registered using MFnPlugin::registerSolver.

Once the solver is registered it can be assigned to IK handles and it's solve methods will be called in the same manner as the solvers within Maya.

Functions

MPxIkSolver:: ~MPxIkSolver ()

Description

Destructor. Local class data should be freed here.

MStatus MPxIkSolver:: preSolve ()

Description

This method is called before doSolve. Users should override this method if there is any preprocessing that needs to be done before solving..

Return value

  • The status code which indicates if the pre-processing was successful

MStatus MPxIkSolver:: doSolve ()

Description

This is where the main solving takes place. The user must override this method.

The purpose of this method is to calculate joint angles in a skeleton based upon the position of the end effector of the handle associated with this solver.

Return value

  • The status code which indicates if the solver was successful

MStatus MPxIkSolver:: postSolve ( MStatus stat )

Description

This method is called after doSolve has finished. The user should override this method if there are any post calculations to be done.

The status argument indicates whether doSolve was successful.

Arguments

  • stat The status returned from doSolve

Return value

  • Status code to indicate whether the post calculations were successful

MString MPxIkSolver:: solverTypeName () const

Description

This method returns the type name of the solver.
The user must override this method in order for the solver to be identifiable when it is registered.
Once the solver is registered, the type name can be used to assign the solver to an ik handle.

Return value

  • The type name of this solver

bool MPxIkSolver:: isSingleChainOnly () const

Description

This method indicates whether this solver is a single chain solver.
Single chain solvers are solvers which act on one handle only, i.e. the handle groups have only one handle if they are for single chain solvers.

Return value

  • true This is a single chain solver
  • false This is not a single chain solver

bool MPxIkSolver:: isPositionOnly () const

Description

Indicates whether the solver supports handle orientation.
This method must be overriden to reflect the users solver.

Return value

  • true the solver does not support handle orientation
  • false the solver supports handle orientation

bool MPxIkSolver:: hasJointLimitSupport () const

Description

This method indicates whether the solver supports limits on joint angles.
This method must be overriden to reflect the users solver.

Return value

  • true solver supports joint limits
  • false solver does not support joint limits

bool MPxIkSolver:: hasUniqueSolution () const

Description

This method indicates whether the solver provides a unique solution.
This method must be overriden to reflect the users solver.

Return value

  • true solver has a unique solution
  • false solver does not have a unique solution

bool MPxIkSolver:: groupHandlesByTopology () const

Description

Indicates whether the IK system should group handles according to skeletal topology.
This method must be overriden to reflect the users solver.

Return value

  • true solver groups handles by topology
  • false solver does not groups handles by topology

MStatus MPxIkSolver:: setFuncValueTolerance ( double tolerance )

Description

Set the error value for this solver.
The user can override this if any other calcluations should be done here.

Arguments

  • tolerance Error value

Return value

  • Status code

MStatus MPxIkSolver:: setMaxIterations ( int value )

Description

Set the maximum iterations for a solution by this solver.
The user can override this if any other calcluations should be done here.

Arguments

  • value value to set

Return value

  • Status code

MIkHandleGroup * MPxIkSolver:: handleGroup () const

Description

Returns the handle group for this solver. The handle group provides access to handles associated with the solver.

Arguments

  • value value to set

Return value

  • A pointer to the ik handle group for this solver

void MPxIkSolver:: setHandleGroup ( MIkHandleGroup * group )

Description

Set the handle group of this solver.

Arguments

  • group The handle group to be set

const MMatrix * MPxIkSolver:: toWorldSpace () const

Description

Returns the world space matrix for this solver.

Return value

  • the world space matrix

const MMatrix * MPxIkSolver:: toSolverSpace () const

Description

Returns the local space matrix for this solver.

Return value

  • the local space matrix

double MPxIkSolver:: funcValueTolerance () const

Description

Return the error value for this solver.

Return value

  • The error value

int MPxIkSolver:: maxIterations () const

Description

Return the the maximum nuber of itertations for a solution by this solver.

Return value

  • The maximum number of iterations

void MPxIkSolver:: snapHandle ( MObject & handle )

Description

This function positions the handle at the end effector position.
The user can override this method.

Arguments

  • handle handle to be set

MStatus MPxIkSolver:: getJointAngles ( MDoubleArray & angles) const

Description

Returns the joint angles.

Arguments

  • angles The array of doubles to hold the angles.

Return value

  • MS::kSuccess The operation was successfull.
  • MS::kFailure The operation failed.

MStatus MPxIkSolver:: setJointAngles ( const MDoubleArray & angles )

Description

Set joint angles to the given values.

Arguments

  • angles The array of angles to set the joints to.

Return value

  • MS::kSucces the joint angles were set
  • MS::kFailure the joint angles were not set

void MPxIkSolver:: setToRestAngles ()

Description

Sets all joints to thier prefered orientations.

MPxIkSolver:: MPxIkSolver ()

Description

Constructor.

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright