#include <MPxIkSolver.h>
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 its solve methods will be called in the same manner as the solvers within Maya.
Public Member Functions | |
virtual | ~MPxIkSolver () |
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 Member Functions | |
MStatus | getJointAngles (MDoubleArray &) const |
MStatus | setJointAngles (const MDoubleArray &) |
void | setToRestAngles () |
MPxIkSolver () |
MPxIkSolver::~MPxIkSolver | ( | ) | [virtual] |
Destructor. Local class data should be freed here.
MPxIkSolver::MPxIkSolver | ( | ) | [protected] |
Constructor.
MStatus MPxIkSolver::preSolve | ( | ) | [virtual] |
This method is called before doSolve. Users should override this method if there is any preprocessing that needs to be done before solving..
MStatus MPxIkSolver::doSolve | ( | ) | [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.
The status argument indicates whether doSolve was successful.
[out] | stat | The status returned from doSolve |
MString MPxIkSolver::solverTypeName | ( | ) | const [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.
bool MPxIkSolver::isSingleChainOnly | ( | ) | const [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.
bool MPxIkSolver::isPositionOnly | ( | ) | const [virtual] |
Indicates whether the solver supports handle orientation. This method must be overriden to reflect the users solver.
bool MPxIkSolver::hasJointLimitSupport | ( | ) | const [virtual] |
This method indicates whether the solver supports limits on joint angles. This method must be overriden to reflect the users solver.
bool MPxIkSolver::hasUniqueSolution | ( | ) | const [virtual] |
This method indicates whether the solver provides a unique solution. This method must be overriden to reflect the users solver.
bool MPxIkSolver::groupHandlesByTopology | ( | ) | const [virtual] |
Indicates whether the IK system should group handles according to skeletal topology. This method must be overriden to reflect the users solver.
MStatus MPxIkSolver::setFuncValueTolerance | ( | double | tolerance | ) | [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 |
MStatus MPxIkSolver::setMaxIterations | ( | int | 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 * MPxIkSolver::handleGroup | ( | ) | const |
Returns the handle group for this solver. The handle group provides access to handles associated with the solver.
void MPxIkSolver::setHandleGroup | ( | MIkHandleGroup * | group | ) | [virtual] |
Set the handle group of this solver.
[in] | group | The handle group to be set |
const MMatrix * MPxIkSolver::toWorldSpace | ( | ) | const |
Returns the world space matrix for this solver.
const MMatrix * MPxIkSolver::toSolverSpace | ( | ) | const |
Returns the local space matrix for this solver.
double MPxIkSolver::funcValueTolerance | ( | ) | const |
Return the error value for this solver.
int MPxIkSolver::maxIterations | ( | ) | const |
Return the the maximum nuber of itertations for a solution by this solver.
void MPxIkSolver::snapHandle | ( | MObject & | handle | ) | [virtual] |
This function positions the handle at the end effector position. The user can override this method.
[in] | handle | handle to be set |
MStatus MPxIkSolver::getJointAngles | ( | MDoubleArray & | angles | ) | const [protected] |
Returns the joint angles.
[out] | angles | The array of doubles to hold the angles. |
MStatus MPxIkSolver::setJointAngles | ( | const MDoubleArray & | angles | ) | [protected] |
Set joint angles to the given values.
[in] | angles | The array of angles to set the joints to. |
void MPxIkSolver::setToRestAngles | ( | ) | [protected] |
Sets all joints to thier prefered orientations.
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |