#include
<MPxFieldNode.h>
MPxFieldNode allows the creation and manipulation of dependency graph nodes representing fields. This is the top level of a hierarchy of field node function sets. It permits manipulation of the attributes common to all types of fields.
dynExprField.h, and torusField.h.
Public Member Functions |
|
MPxFieldNode () | |
virtual | ~MPxFieldNode () |
virtual MPxNode::Type | type () const |
virtual MStatus | compute (const MPlug &plug, MDataBlock &dataBlock) |
virtual MStatus | getForceAtPoint (const MVectorArray &point, const MVectorArray &velocity, const MDoubleArray &mass, MVectorArray &force, double deltaTime) |
virtual MStatus | iconSizeAndOrigin (GLuint &width, GLuint &height, GLuint &xbo, GLuint &ybo) |
virtual MStatus | iconBitmap (GLubyte *bitmap) |
virtual void | draw (M3dView &view, const MDagPath &path, M3dView::DisplayStyle style, M3dView::DisplayStatus) |
virtual double | falloffCurve (const double param, MStatus *ReturnStatus=NULL) |
virtual bool | isFalloffCurveConstantOne (MStatus *ReturnStatus=NULL) |
Static Public Attributes |
|
static MObject | mMagnitude |
magnitude attribute |
|
static MObject | mAttenuation |
attenuation attribute |
|
static MObject | mMaxDistance |
maximum distance attribute |
|
static MObject | mUseMaxDistance |
flag for maximum distance
attribute |
|
static MObject | mApplyPerVertex |
flag for per vertex attribute |
|
static MObject | mInputData |
input attribute compound, multi |
|
static MObject | mInputPositions |
child attribute, multi |
|
static MObject | mInputVelocities |
child attribute, multi |
|
static MObject | mInputMass |
child attribute, multi |
|
static MObject | mDeltaTime |
child attribute |
|
static MObject | mInputForce |
forces input attribute, multi |
|
static MObject | mOutputForce |
forces output attribute, multi |
|
static MObject | mOwnerCentroidX |
X component of mOwnerCentroid. |
|
static MObject | mOwnerCentroidY |
Y component of mOwnerCentroid. |
|
static MObject | mOwnerCentroidZ |
Z component of mOwnerCentroid. |
|
static MObject | mOwnerCentroid |
owner centroid attribute |
|
static MObject | mOwnerPosData |
owner position attribute, multi |
|
static MObject | mOwnerVelData |
owner velocity attribute, multi |
|
static MObject | mWorldMatrix |
world matrix attribute |
|
static MObject | mInputPPData |
Attribute for input pp data from
particleShape. |
|
static MObject | mOwnerPPData |
Attribute for input pp data from owner
particleShape. |
MPxFieldNode::MPxFieldNode | ( | ) |
Class constructor.
MPxFieldNode::~MPxFieldNode | ( | ) | [virtual] |
The class destructor.
MPxNode::Type MPxFieldNode::type | ( | ) | const [virtual] |
This method returns the type of the node. This method should not be overridden by the user. It will return MPxNode::kFieldNode.
Reimplemented from MPxNode.
MStatus MPxFieldNode::compute | ( | const MPlug & | plug, | |
MDataBlock & | dataBlock | |||
) | [virtual] |
This method should be overridden in user defined nodes.
Recompute the given output based on the nodes inputs. The plug represents the data value that needs to be recomputed, and the data block holds the storage for all of the node's attributes.
The MDataBlock will provide smart handles for reading and writing this node's attribute values. Only these values should be used when performing computations.
When evaluating the dependency graph, Maya will first call the compute method for this node. If the plug that is provided to the compute indicates that that the attribute was defined by the Maya parent node, the compute method should return MS::kUnknownParameter. When this occurs, Maya will call the internal Maya node from which the user-defined node is derived to compute the plug's value.
This means that a user defined node does not need to be concerned with computing inherited output attributes. However, if desired, these can be safely recomputed by this method to change the behaviour of the node.
[in] | plug | plug representing the attribute that needs to be recomputed |
[in] | dataBlock | data block containing storage for the node's attributes |
Reimplemented from MPxNode.
MStatus MPxFieldNode::getForceAtPoint | ( | const MVectorArray & | point, | |
const MVectorArray & | velocity, | |||
const MDoubleArray & | mass, | |||
MVectorArray & | force, | |||
double | deltaTime | |||
) | [virtual] |
This method is not required to be overridden, it is only necessary for compatibility with the MFnField function set.
Compute the force of a field on an array of points, given their position, velocity, and mass.
This method uses MVectorArray to represent the positions of a point.
[in] | point | array of positions for each point. |
[in] | velocity | array of velocities for each point. If the length of the velocity array is 0, a velocity of 0.0 is assumed for all the points. Note the velocity array is a requirement for the Air and Drag fields to compute forces. |
[in] | mass | array of mass values for each point. If the length of the mass array is 0, a mass of 1.0 is assumed for all the points. |
[out] | force | output array of forces applied to each point. If the length of the force array supplied is 0, the array is automatically resized. If the contents of the force array contains data, the computed force is added to the supplied data. This can be useful to accumulate forces of multiple fields. |
[in] | deltaTime | time increment in seconds |
MStatus MPxFieldNode::iconSizeAndOrigin | ( | GLuint & | width, | |
GLuint & | height, | |||
GLuint & | xbo, | |||
GLuint & | ybo | |||
) | [virtual] |
Define the size and the origin of the field's icon.
Maya calls this method to determine the size and origin of the icon you wish your field to use. Overriding this method is optional.
The arguments have the same meaning as defined in OpenGL's glBitmap method.
[out] | width | the width of the icon in pixels. It needs to be a multiple of 32 on windows and a multiple of 16 on any other platform. |
[out] | height | the height of the icon in pixels. It needs to be a multiple of 32 on windows and a multiple of 16 on any other platform. |
[out] | xbo | the origin of the icon in x direction. |
[out] | ybo | the origin of the icon in y direction. |
MStatus MPxFieldNode::iconBitmap | ( | GLubyte * | bitmap | ) | [virtual] |
Define the bitmap for the field's icon.
Maya calls this method to get the bitmap for the icon you wish your field to use. Overriding this method is optional, but if you do override it then you must also override iconSizeAndOrigin().
[out] | bitmap | Bitmap for the field's icon, in the format expected by OpenGL's glBitmap() function. The storage pointed to by this parameter will have already been allocated by Maya according to the values returned by iconSizeAndOrigin(). |
void MPxFieldNode::draw | ( | M3dView & | view, | |
const MDagPath & | path, | |||
M3dView::DisplayStyle | style, | |||
M3dView::DisplayStatus | ||||
) | [virtual] |
Overriding this method allows the drawing of custom geometry using standard OpenGL calls. The OpenGL state should be left in the same state that it was in previously. The OpenGL routine glPushAttrib may be used to make this easier.
When this routine is called, the following conditions may be assumed:
[in] | view | 3D view that is being drawn into |
[in] | path | to this node in the DAG |
[in] | style | style to draw object in |
double MPxFieldNode::falloffCurve | ( | const double | param, | |
MStatus * | ReturnStatus =
NULL |
|||
) | [virtual] |
Returns the falloff at the given parameter value.
[in] | param | Parameter value in the range [0.0, 1.0] |
[out] | ReturnStatus | Status code |
bool MPxFieldNode::isFalloffCurveConstantOne | ( | MStatus * | ReturnStatus =
NULL |
) | [virtual] |
Returns true if the falloffCurve is a constant one (default) or false if not.
[out] | ReturnStatus | Status code |
Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |