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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Static Public Attributes

# MPxSpringNode Class Reference

# OpenMayaFX - API module for effects | Proxy classes

This reference page is linked to from the following overview topics: Parent class descriptions.

Search for all occurrences

## Detailed Description

Base class for user defined spring law.

MPxSpringNode allows the creation and manipulation of dependency graph nodes representing a spring law. The class is a DAG node and Maya manages the drawing, creation, and selection of springs.

A user defined spring node is a DAG node that can have attributes and a applySpringLaw() method. To derive the full benefit of the MPxSpringNode class, it is suggested that you do not write your own compute() method. Instead, write the applySpringLaw() method. All of the parameters passed into this method will be supplied by Maya.

To create a user defined spring node, derive from this class and override the applySpringLaw() method. The other methods of the parent class MPxNode may also be overridden to perform dependency node capabilities.

Examples:

  simpleSpring.h.

`#include <MPxSpringNode.h>`

Inheritance diagram for MPxSpringNode:
[legend]

List of all members.

## Public Member Functions
| MPxSpringNode ()
| Class constructor.
virtual | ~MPxSpringNode ()
| Class destructor.
virtual MPxNode::Type | type () const
| This method returns the type of the node.
virtual MStatus | applySpringLaw (double stiffness, double damping, double restLength, double endMass1, double endMass2, const MVector &endP1, const MVector &endP2, const MVector &endV1, const MVector &endV2, MVector &forceV1, MVector &forceV2)
| This method should be overridden in user defined nodes.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.
## Static Public Attributes
static MObject | mEnd1Weight
| from end weight attribute Search for all occurrences
static MObject | mEnd2Weight
| to end weight attribute Search for all occurrences
static MObject | mDeltaTime
| delta time attribute Search for all occurrences

## Member Function Documentation

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

Search for all occurrences

This method returns the type of the node.

It should not be overridden by the user. It will return MPxNode::kSpringNode.

Returns:
  The type of node

Status Codes:
  - MS::kSuccess The undo was successful
  - MS::kFailure This method is not undoable

Reimplemented from MPxNode.

MStatus applySpringLaw | ( | double | stiffness,
|  | double | damping,
|  | double | restLength,
|  | double | endMass1,
|  | double | endMass2,
|  | const MVector & | endP1,
|  | const MVector & | endP2,
|  | const MVector & | endV1,
|  | const MVector & | endV2,
|  | MVector & | forceV1,
|  | MVector & | forceV2
| ) |  | `[virtual]`

Search for all occurrences

This method should be overridden in user defined nodes.

Parameters:

  [in] | stiffness | The strength with which springs are trying to maintain their length.
  [in] | damping | How strongly the motion of springs are damped by the 'physical' properties of the springs. A larger value makes the springs converge faster to their rest length.
  [in] | restLength | The length at which springs try to stay.
  [in] | endMass1 | The mass value at one end of the spring.
  [in] | endMass2 | The mass value at the other end of the spring.
  [in] | endP1 | The position of one end of the spring.
  [in] | endP2 | The position of the other end of the spring.
  [in] | endV1 | The velocity of one end of the spring.
  [in] | endV2 | The velocity of the other end of the spring.
  [in] | forceV1 | The output force vector at one end of the spring.
  [in] | forceV2 | The output force vector at the other end of the spring.

Returns:
  Status code

Status Codes:
  - MS::kSuccess Compute was successful.
  - MS::kFailure Compute failed.

Examples:
  simpleSpring.h.

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  The name of this class.

Reimplemented from MPxNode.

MPxSpringNode MPxSpringNode MPxSpringNode MPxSpringNode MPxSpringNode MPxSpringNode MPxSpringNode MPxSpringNode MPxSpringNode MPxSpringNode
MPxSpringNode MPxSpringNode MPxSpringNode MPxSpringNode MPxSpringNode MPxSpringNode MPxSpringNode MPxSpringNode MPxSpringNode MPxSpringNode