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

MPxSpringNode Class Reference

This reference page is linked to from the following overview topics: Parent class descriptions, MPxNode and its derived classes, Overview of example plug-ins.


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:
Inheritance graph
[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
static MObject mEnd2Weight
 to end weight attribute
static MObject mDeltaTime
 delta time attribute

Member Function Documentation

MPxNode::Type type ( ) const [virtual]

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:

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]

This method should be overridden in user defined nodes.

Parameters:
[in]stiffnessThe strength with which springs are trying to maintain their length.
[in]dampingHow 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]restLengthThe length at which springs try to stay.
[in]endMass1The mass value at one end of the spring.
[in]endMass2The mass value at the other end of the spring.
[in]endP1The position of one end of the spring.
[in]endP2The position of the other end of the spring.
[in]endV1The velocity of one end of the spring.
[in]endV2The velocity of the other end of the spring.
[in]forceV1The output force vector at one end of the spring.
[in]forceV2The output force vector at the other end of the spring.
Returns:
Status code
Status Codes:
Examples:
simpleSpring.h.
const char * className ( ) [static]

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