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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions

# MFnDragField Class Reference
OpenMayaFX - API module for effects | FunctionSet classes

Search for all occurrences

## Detailed Description

Function set for Drag Fields.

Function set for creation, edit, and query of Drag Fields.

A drag field exerts a friction, or braking force, proportional to the speed of a moving object.

`#include <MFnDragField.h>`

Inheritance diagram for MFnDragField:
[legend]

List of all members.

## Public Member Functions
virtual MFn::Type | type () const
| Function set type.
virtual | ~MFnDragField ()
| Destructor.
| MFnDragField ()
| Default constructor.
| MFnDragField (MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
| MFnDragField (const MDagPath &object, MStatus *ret=NULL)
| Constructor.
MVector | direction (MStatus *ReturnStatus=NULL) const
| Returns the direction of the drag force's influence along the x, y, and z axes.
MStatus | setDirection (const MVector &dragDirection)
| Sets the direction of the drag force's influence along the x, y, and z axes.
bool | useDirection (MStatus *ReturnStatus=NULL) const
| Returns true if the braking force is exerted only against the component of the object's velocity that lies along the direction of the drag force.
MStatus | setUseDirection (bool enable)
| Enables the braking force to be exerted only against the component of the object's velocity that lies along the direction setting of the drag force.
| MFnDragField (const MObject &object, MStatus *ret=NULL)
| Constructor.
## Protected Member Functions
virtual const char * | className () const
| Class name. Search for all occurrences

## Constructor & Destructor Documentation

~MFnDragField | ( |  | ) | `[virtual]`

Destructor.

Class destructor.

MFnDragField | ( | MObject & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:

  [in] | object | The MObject to attach the function set to
  [out] | ReturnStatus | the return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnDragField | ( | const MDagPath & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Class constructor that initializes the function set to the given constant MDagPath object.

Parameters:

  [in] | object | The const MDagPath to attach the function set to
  [out] | ReturnStatus | The return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnDragField | ( | const MObject & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:

  [in] | object | The MObject to attach the function set to
  [out] | ReturnStatus | the return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

## Member Function Documentation

MFn::Type type | ( |  | ) | const`[virtual]`

Search for all occurrences

Function set type.

Return the class type : MFn::kDrag.

Reimplemented from MFnField.

MVector direction | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the direction of the drag force's influence along the x, y, and z axes.

You must have the Use Direction setting turned on for this attribute to take effect.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  A vector representing direction.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus setDirection | ( | const MVector & | dragDirection | ) |

Search for all occurrences

Sets the direction of the drag force's influence along the x, y, and z axes.

You must have the Use Direction setting turned on for this attribute to take effect.

Parameters:

  [in] | dragDirection | A vector representing direction.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

bool useDirection | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns true if the braking force is exerted only against the component of the object's velocity that lies along the direction of the drag force.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  - true Use the direction setting to determine the braking force.
  - false Use the objects velocity to determine the braking force.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus setUseDirection | ( | bool | enable | ) |

Search for all occurrences

Enables the braking force to be exerted only against the component of the object's velocity that lies along the direction setting of the drag force.

Parameters:

  [in] | enable | Flag to enable or disable direction setting.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MFnDragField MFnDragField MFnDragField MFnDragField MFnDragField MFnDragField MFnDragField MFnDragField MFnDragField MFnDragField
MFnDragField MFnDragField MFnDragField MFnDragField MFnDragField MFnDragField MFnDragField MFnDragField MFnDragField MFnDragField