- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Friends

# MnSolver Class Reference

# OpenMayaFX - API module for effects

Search for all occurrences

## Detailed Description

Class for wrapping N solver objects.

This class wraps the internal Maya representation of a Nucleus solver suitable for use with the Nucleus objects such as nCloth or nParticles

`#include <MnSolver.h>`

List of all members.

## Public Member Functions
| MnSolver ()
| Default constructor.
virtual | ~MnSolver ()
| The class destructor.
MStatus | createNSolver ()
| Creates the underlying Maya solver object and sets this class to wrap it.
MStatus | addNObject (MnObject *obj)
| Assign the nucleus object to be solved by this solver.
MStatus | removeNObject (MnObject *obj)
| Remove the nucleus object from being solved by this solver.
MStatus | setGravity (float grav)
| Sets the gravity magnitude for the objects being solved.
MStatus | setGravityDir (float gravX, float gravY, float gravZ)
| Sets the gravity direction for the underlying Maya solver object.
MStatus | setAirDensity (float dens)
| Sets the air Density for the solver.
MStatus | setWindSpeed (float speed)
| Sets the wind magnitude for the underlying Maya solver object.
MStatus | setWindDir (float windX, float windY, float windZ)
| Sets the wind direction for the underlying Maya solver object.
MStatus | setWindNoiseIntensity (float noise)
| Sets the wind noise intensity for the underlying Maya solver object.
MStatus | setDisabled (bool disabled)
| Disables the solver - or re-enables it again.
MStatus | setSubsteps (int substeps)
| Set the number of substeps used by the solver.
MStatus | setMaxIterations (int maxIter)
| Set the max number of collision iterations used by the solver.
MStatus | setStartTime (float startTime)
| Sets the start Time in seconds for the solver.
MStatus | makeAllCollide ()
| Allow all the objects assigned to the Maya solver object to collide.
MStatus | removeAllCollisions ()
| Remove the collisions between all the objects assigned to the Maya solver object.
MStatus | solve (float solveTime)
| Solve from the last eval time until the specified time (in seconds).
## Friends
class | MFnNObjectData Search for all occurrences

## Constructor & Destructor Documentation

MnSolver | ( |  | ) |

Default constructor.

The instance is set to contain nothing.

## Member Function Documentation

MStatus createNSolver | ( |  | ) |

Search for all occurrences

Creates the underlying Maya solver object and sets this class to wrap it.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus addNObject | ( | MnObject * | obj | ) |

Search for all occurrences

Assign the nucleus object to be solved by this solver.

Parameters:

  [in] | obj | Nucleus object.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the object was added to the solver successfully
  - MS::kFailure the object could not be added to the solver

MStatus removeNObject | ( | MnObject * | obj | ) |

Search for all occurrences

Remove the nucleus object from being solved by this solver.

Parameters:

  [in] | obj | Nucleus object.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the object was removed from the solver successfully
  - MS::kFailure the object could not be removed from the solver

MStatus setGravity | ( | float | grav | ) |

Search for all occurrences

Sets the gravity magnitude for the objects being solved.

Note the the objects should already be added to the solver when applying gravity

Parameters:

  [in] | grav | New gravity value.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setGravityDir | ( | float | gravX,
|  | float | gravY,
|  | float | gravZ
| ) |  |

Search for all occurrences

Sets the gravity direction for the underlying Maya solver object.

Parameters:

  [in] | gravX | X coordinate of new gravity direction.
  [in] | gravY | Y coordinate of new gravity direction.
  [in] | gravZ | Z coordinate of new gravity direction.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setAirDensity | ( | float | dens | ) |

Search for all occurrences

Sets the air Density for the solver.

Parameters:

  [in] | dens | New density value.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setWindSpeed | ( | float | speed | ) |

Search for all occurrences

Sets the wind magnitude for the underlying Maya solver object.

Parameters:

  [in] | speed | New wind speed.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setWindDir | ( | float | windX,
|  | float | windY,
|  | float | windZ
| ) |  |

Search for all occurrences

Sets the wind direction for the underlying Maya solver object.

Parameters:

  [in] | windX | X coordinate of new wind direction.
  [in] | windY | Y coordinate of new wind direction.
  [in] | windZ | Z coordinate of new wind direction.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setWindNoiseIntensity | ( | float | noise | ) |

Search for all occurrences

Sets the wind noise intensity for the underlying Maya solver object.

Parameters:

  [in] | noise | New wind noise intensity.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setDisabled | ( | bool | disabled | ) |

Search for all occurrences

Disables the solver - or re-enables it again.

Parameters:

  [in] | disabled | True to disable the solver, false to re-enable it.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setSubsteps | ( | int | substeps | ) |

Search for all occurrences

Set the number of substeps used by the solver.

Parameters:

  [in] | substeps | New number of substeps to use.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setMaxIterations | ( | int | maxIter | ) |

Search for all occurrences

Set the max number of collision iterations used by the solver.

Parameters:

  [in] | maxIter | New maximum number of iterations to use.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setStartTime | ( | float | startTime | ) |

Search for all occurrences

Sets the start Time in seconds for the solver.

Parameters:

  [in] | startTime | New start time.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus makeAllCollide | ( |  | ) |

Search for all occurrences

Allow all the objects assigned to the Maya solver object to collide.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus removeAllCollisions | ( |  | ) |

Search for all occurrences

Remove the collisions between all the objects assigned to the Maya solver object.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus solve | ( | float | solveTime | ) |

Search for all occurrences

Solve from the last eval time until the specified time (in seconds).

Parameters:

  [in] | solveTime | Time to solve up to.

Returns:
  Status code

Status Codes:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MnSolver MnSolver MnSolver MnSolver MnSolver MnSolver MnSolver MnSolver MnSolver MnSolver
MnSolver MnSolver MnSolver MnSolver MnSolver MnSolver MnSolver MnSolver MnSolver MnSolver