MPxSpringNode Class Reference
[OpenMayaFX - API module for effectsProxy classes]

#include <MPxSpringNode.h>
Inheritance diagram for MPxSpringNode:
Inheritance graph
[legend]
Collaboration diagram for MPxSpringNode:
Collaboration graph
[legend]

List of all members.


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.


Public Member Functions

  MPxSpringNode ()
virtual  ~MPxSpringNode ()
virtual MPxNode::Type  type () const
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)

Static Public Attributes

static MObject  mEnd1Weight
  from end weight attribute
static MObject  mEnd2Weight
  to end weight attribute
static MObject  mDeltaTime
  delta time attribute

Constructor & Destructor Documentation

MPxSpringNode::MPxSpringNode (  ) 

Class constructor.

MPxSpringNode::~MPxSpringNode (  )  [virtual]

Class destructor.


Member Function Documentation

MPxNode::Type MPxSpringNode::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 MPxSpringNode::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:

Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. Generated with doxygen 1.5.6