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.


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] 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:
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