C++ API Reference
|
OBSOLETE CLASS: Base class for user defined IK solvers. More...
#include <MPxIkSolver.h>
Public Member Functions | |
virtual | ~MPxIkSolver () |
Destructor. More... | |
virtual MStatus | preSolve () |
This method is called before doSolve. More... | |
virtual MStatus | doSolve () |
This is where the main solving takes place. More... | |
virtual MStatus | postSolve (MStatus) |
This method is called after doSolve has finished. More... | |
virtual MString | solverTypeName () const |
This method returns the type name of the solver. More... | |
virtual bool | isSingleChainOnly () const |
This method indicates whether this solver is a single chain solver. More... | |
virtual bool | isPositionOnly () const |
Indicates whether the solver supports handle orientation. More... | |
virtual bool | hasJointLimitSupport () const |
This method indicates whether the solver supports limits on joint angles. More... | |
virtual bool | hasUniqueSolution () const |
This method indicates whether the solver provides a unique solution. More... | |
virtual bool | groupHandlesByTopology () const |
Indicates whether the IK system should group handles according to skeletal topology. More... | |
virtual MStatus | setFuncValueTolerance (double tolerance) |
Set the error value for this solver. More... | |
virtual MStatus | setMaxIterations (int value) |
Set the maximum iterations for a solution by this solver. More... | |
MIkHandleGroup * | handleGroup () const |
Returns the handle group for this solver. More... | |
virtual void | setHandleGroup (MIkHandleGroup *) |
Set the handle group of this solver. More... | |
const MMatrix * | toWorldSpace () const |
Returns the world space matrix for this solver. More... | |
const MMatrix * | toSolverSpace () const |
Returns the local space matrix for this solver. More... | |
double | funcValueTolerance () const |
Return the error value for this solver. More... | |
int | maxIterations () const |
Return the the maximum nuber of itertations for a solution by this solver. More... | |
virtual void | snapHandle (MObject &handle) |
This function positions the handle at the end effector position. More... | |
Static Public Member Functions | |
static const char * | className () |
Returns the name of this class. More... | |
Protected Member Functions | |
MStatus | getJointAngles (MDoubleArray &) const |
Returns the joint angles. More... | |
MStatus | setJointAngles (const MDoubleArray &) |
Set joint angles to the given values. More... | |
void | setToRestAngles () |
Sets all joints to thier prefered orientations. | |
MPxIkSolver () | |
Constructor. | |
OBSOLETE CLASS: Base class for user defined IK solvers.
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:
Users can optionally override the following methods if they want to perform work before or after doSolve is called:
If users override these methods, they are responsible for calling the base class implementation of the overridden method(s). The base class handles a few things such as solver locking/unlocking and FK/IK solution blending. If users fail to call the base class implementation, instabilities can occur leading to wrong evaluation or even crashes.
To register a solver, write a creator method to return an instance of the user solver:
The solver can then be registered using MFnPlugin::registerSolver.
Once the solver is registered it can be assigned to IK handles and its solve methods will be called in the same manner as the solvers within Maya.
This method is obsolete. [from before Maya 2016]
|
virtual |
Destructor.
Local class data should be freed here.
|
virtual |
This method is called before doSolve.
Users should override this method if there is any preprocessing that needs to be done before solving..
If this method is overridden, users are responsible for calling base class version MPxIkSolver::preSolve.
|
virtual |
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.
This method is called after doSolve has finished.
The user should override this method if there are any post calculations to be done.
If this method is overridden, users are responsible for calling base class version MPxIkSolver::postSolve.
The status argument indicates whether doSolve was successful.
[out] | stat | The status returned from doSolve |
|
virtual |
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.
|
virtual |
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.
|
virtual |
Indicates whether the solver supports handle orientation.
This method must be overridden to reflect the users solver.
|
virtual |
This method indicates whether the solver supports limits on joint angles.
This method must be overridden to reflect the users solver.
|
virtual |
This method indicates whether the solver provides a unique solution.
This method must be overridden to reflect the users solver.
|
virtual |
Indicates whether the IK system should group handles according to skeletal topology.
This method must be overridden to reflect the users solver.
|
virtual |
Set the error value for this solver.
The user can override this if any other calcluations should be done here.
[in] | tolerance | Error value |
|
virtual |
Set the maximum iterations for a solution by this solver.
The user can override this if any other calcluations should be done here.
[in] | value | value to set |
MIkHandleGroup * handleGroup | ( | ) | const |
Returns the handle group for this solver.
The handle group provides access to handles associated with the solver.
|
virtual |
Set the handle group of this solver.
[in] | group | The handle group to be set |
const MMatrix * toWorldSpace | ( | ) | const |
Returns the world space matrix for this solver.
const MMatrix * toSolverSpace | ( | ) | const |
Returns the local space matrix for this solver.
double funcValueTolerance | ( | ) | const |
Return the error value for this solver.
int maxIterations | ( | ) | const |
Return the the maximum nuber of itertations for a solution by this solver.
|
virtual |
This function positions the handle at the end effector position.
The user can override this method.
[in] | handle | handle to be set |
|
static |
Returns the name of this class.
|
protected |
Returns the joint angles.
[out] | angles | The array of doubles to hold the angles. |
|
protected |
Set joint angles to the given values.
[in] | angles | The array of angles to set the joints to. |