MPxConstraint Class Reference
[OpenMayaAnim - API module for animationProxy classes]

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

List of all members.


Detailed Description

Proxy constraint node.

MPxConstraint is the parent class for user defined constraint nodes. Position, orientation or scale of an object can be constrained by other objects. This class works in conjunction with the MPxConstraintCommand class.

Examples:

geometrySurfaceConstraint.cpp, and geometrySurfaceConstraint.h.


Public Types

enum   UpVectorType {
   kScene = 0, kObject, kObjectRotation, kVector,
   kLast
}
  The type of up vector. More...

Public Member Functions

  MPxConstraint ()
virtual  ~MPxConstraint ()
virtual const MObject  weightAttribute () const
virtual const MObject  targetAttribute () const
virtual const MObject  constraintRotateOrderAttribute () const

Static Public Attributes

static MObject  enableRestPosition

Protected Member Functions

virtual const MObject  passiveOutputAttribute () const
virtual void  getOutputAttributes (MObjectArray &attributeArray)
MStatus  closestPoint (const MObject &dataGeometryObject, const MPoint &toThisPoint, MPoint &theClosestPoint) const
MStatus  closestNormal (const MObject &dataGeometryObject, const MPoint &toThisPoint, MVector &theNormal) const
MStatus  closestTangent (const MObject &dataGeometryObject, const MPoint &toThisPoint, MVector &theTangent) const
MEulerRotation  computeAim (const MMatrix &parentInverseMatrix, const MVector &targetVector, const MVector &aimVector, const MVector &upVector, const MVector &wupVector, MEulerRotation::RotationOrder order=MEulerRotation::kXYZ, const MQuaternion &jointOrient=MQuaternion::identity, MStatus *ResultStatus=NULL) const
MVector  worldUpVector (MPxConstraint::UpVectorType upType, const MVector &upVector, const MMatrix &upMatrix, const MPoint &constrPoint, MStatus *ResultStatus=NULL) const
MPoint  worldConstraintPoint (const MMatrix &parentInverseMatrix, const MVector &translate, const MVector &rotatePivot, const MVector &rotatePivotTranslate, MStatus *ResultStatus=NULL) const

Member Enumeration Documentation

The type of up vector.

Enumerator:
kScene  Scene up vector.
kObject  Object up vector.
kObjectRotation  Object rotation up vector.
kVector  Specified vector.
kLast  Last value, used for counting.

Constructor & Destructor Documentation

MPxConstraint::MPxConstraint (  ) 

Constructor.

The constructor should never call any methods from MPxConstraint or make any calls that require the existence of the MObject associated with the user defined node. The postConstructor method should be used to do any initialization of this kind.

MPxConstraint::~MPxConstraint (  )  [virtual]

Destructor.


Member Function Documentation

const MObject MPxConstraint::weightAttribute (  )  const [virtual]

Returns the weight attribute for the constraint. Default implementation returns MObject::kNullObj.

Examples:

const MObject MPxConstraint::targetAttribute (  )  const [virtual]

Returns the target attribute for the constraint. Default implementation returns MObject::kNullObj.

Examples:

const MObject MPxConstraint::constraintRotateOrderAttribute (  )  const [virtual]

Returns the rotate order attribute for the constraint. Default implementation returns MObject::kNullObj.

If is only necessary to override this method if the constraint will control rotation.

const MObject MPxConstraint::passiveOutputAttribute (  )  const [protected, virtual]

Returns the passive output attribute for the constraint. Default implementation returns MObject::kNullObj.

Passive output attributes do not prevent value modifications to the destination attribute when connected.

void MPxConstraint::getOutputAttributes ( MObjectArray attributeArray  )  [protected, virtual]

Returns output attributes for the constraint. Default implementation clears the input attributeArray and returns.

Examples:

MStatus MPxConstraint::closestPoint ( const MObject dataGeometryObject,
const MPoint toThisPoint,
MPoint theClosestPoint  
) const [protected]

Returns the closest point on this surface to the given point.

Parameters:
[in]  dataGeometryObject  surface
[in]  toThisPoint  the point to evaluate from
[out]  theClosestPoint  the calculated closest point
Returns:
Status code
Status Codes:

MStatus MPxConstraint::closestNormal ( const MObject dataGeometryObject,
const MPoint toThisPoint,
MVector theNormal  
) const [protected]

Returns the closest normal on this surface to the given point.

Parameters:
[in]  dataGeometryObject  surface
[in]  toThisPoint  the point to evaluate from
[out]  theNormal  the calculated closest normal
Returns:
Status code
Status Codes:

MStatus MPxConstraint::closestTangent ( const MObject dataGeometryObject,
const MPoint toThisPoint,
MVector theTangent  
) const [protected]

Returns the closest tangent on this surface to the given point.

Parameters:
[in]  dataGeometryObject  surface
[in]  toThisPoint  the point to evaluate from
[out]  theTangent  the calculated closest tangent
Returns:
Status code
Status Codes:

MEulerRotation MPxConstraint::computeAim ( const MMatrix parentInverseMatrix,
const MVector targetVector,
const MVector aimVector,
const MVector upVector,
const MVector wUpVector,
MEulerRotation::RotationOrder  order = MEulerRotation::kXYZ,
const MQuaternion jointOrient = MQuaternion::identity,
MStatus ResultStatus = NULL  
) const [protected]

Returns the rotation which aligns the aimVector in local space with the targetVector in local space while keeping the upVector in local space and the wUpVector world space aligned as closely as possible.

Parameters:
[in]  parentInverseMatrix 
[in]  targetVector 
[in]  aimVector 
[in]  upVector 
[in]  wUpVector 
[in]  order 
[in]  jointOrient 
[out]  ResultStatus 
Returns:
Aim rotation.
Status Codes:

MVector MPxConstraint::worldUpVector ( MPxConstraint::UpVectorType  upType,
const MVector upVector,
const MMatrix upMatrix,
const MPoint constrPoint,
MStatus ResultStatus = NULL  
) const [protected]

Returns the world up vector based on the requested up type.

Parameters:
[in]  upType 
[in]  upVector 
[in]  upMatrix 
[in]  constrPoint 
[out]  ResultStatus 
Returns:
World up vector.
Status Codes:

MPoint MPxConstraint::worldConstraintPoint ( const MMatrix parentInverseMatrix,
const MVector translate,
const MVector rotatePivot,
const MVector rotatePivotTranslate,
MStatus ResultStatus = NULL  
) const [protected]

Returns the world constraint point.

Parameters:
[in]  parentInverseMatrix 
[in]  translate 
[in]  rotatePivot 
[in]  rotatePivotTranslate 
[out]  ResultStatus 
Returns:
World constraint point.
Status Codes:

Member Data Documentation

*************************************************************** (C) Copyright 2006 by Autodesk, Inc. All Rights Reserved. By using this code, you are agreeing to the terms and conditions of the License Agreement included in the documentation for this code. AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK PROVIDES THE CODE ON AN 'AS-IS' BASIS AND EXPLICITLY DISCLAIMS ANY LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS, OMISSIONS, AND OTHER PROBLEMS IN THE CODE.

Use, duplication, or disclosure by the U.S. Government is subject to restrictions set forth in FAR 52.227-19 (Commercial Computer Software Restricted Rights) as well as DFAR 252.227-7013(c)(1)(ii) (Rights in Technical Data and Computer Software), as applicable.


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