#include
<MPxFluidEmitterNode.h>
List of all
members.
Detailed Description
Base class for user defined particle emitters.
MPxFluidEmitterNode
allows the creation and manipulation of dependency graph nodes
representing fluid emitters.
Constructor & Destructor Documentation
MPxFluidEmitterNode::MPxFluidEmitterNode |
( |
|
) |
|
MPxFluidEmitterNode::~MPxFluidEmitterNode |
( |
|
) |
[virtual] |
Member Function Documentation
This method returns the type of the node. It should not be
overridden by the user. It will return MPxNode::kEmitterNode.
- Returns:
- The type of node
Reimplemented from MPxEmitterNode.
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.
- Parameters:
-
[in] |
plug |
plug representing the attribute that needs to be
recomputed |
[in] |
dataBlock |
data block containing storage for the node's attributes |
- Returns:
- Status code
- Status Codes:
-
Reimplemented from MPxEmitterNode.
MStatus
MPxFluidEmitterNode::fluidEmitter |
( |
const MObject & |
fluidObj, |
|
|
const MMatrix & |
worldMatrix, |
|
|
int |
plugIndex |
|
|
) |
|
|
[virtual] |
This is the main method that plug-in fluid emitter nodes must
override in order to emit into fluids. When an emitter is attached
to a fluid, at every evaluation step the fluid will call this
method on the emitter. The method receives a fluid object into
which to emit, the index of the fluid in the array of fluid targets
for this emitter, and the worldspace matrix of the fluid. The
emitter should query its attributes to determine how much density,
heat, color, and/or fuel to emit into the fluid, then call the
MFnFluid::emitIntoArrays()
method to actually add the necessary quantities to the fluid.
Returning MS::kUnknownParameter
from this method will cause Maya to execute the default fluid
emitter's emission behavior.
- Parameters:
-
[in] |
fluidObj |
the fluid object into which the emitter is emitting. |
[in] |
worldMatrix |
object to world transformation matrix for the fluid |
[in] |
plugIndex |
the index of the fluid in the array of emission targets for
this emitter. Pass this value to the random number stream
generation routines in MPxEmitterNode. |
- Returns:
- Status code
- Status Codes:
-
- MS::kSuccess Return
kSuccess to indicate that the plug-in node successfully performed
the emission step.
- MS::kUnknownParameter
Return kUnknownParameter to tell Maya to execute the standard
internal fluid emitter behavior for this time step.
double
MPxFluidEmitterNode::fluidDensityEmission |
( |
MDataBlock & |
block |
) |
|
Intended to be called from within the emitter's
compute() method, this method retrieves the
"fluidDensityEmission" attribute value common to all fluid
emitters. This indicates the amount of fluid material to be emitted
per second, and it is modulated by the emitter's "rate" attribute
value.
- Parameters:
-
[in] |
block |
data block containing storage for the node's attributes |
- Returns:
- The fluid density emission rate for the fluid emitter.
double
MPxFluidEmitterNode::fluidHeatEmission |
( |
MDataBlock & |
block |
) |
|
Intended to be called from within the emitter's
compute() method, this method retrieves the "fluidHeatEmission"
attribute value common to all fluid emitters. This indicates the
amount of heat to be emitted per second, and it is modulated by the
emitter's "rate" attribute value.
- Parameters:
-
[in] |
block |
data block containing storage for the node's attributes |
- Returns:
- The fluid heat emission rate for the fluid emitter.
double
MPxFluidEmitterNode::fluidFuelEmission |
( |
MDataBlock & |
block |
) |
|
Intended to be called from within the emitter's
compute() method, this method retrieves the "fluidFuelEmission"
attribute value common to all fluid emitters. This indicates the
amount of fuel to be emitted per second, and it is modulated by the
emitter's "rate" attribute value.
- Parameters:
-
[in] |
block |
data block containing storage for the node's attributes |
- Returns:
- The fluid fuel emission rate for the fluid emitter.
bool MPxFluidEmitterNode::fluidEmitColor |
( |
MDataBlock & |
block |
) |
|
Intended to be called from within the emitter's
compute() method, this method retrieves the "fluidEmitColor"
attribute value common to all fluid emitters. This indicates
whether or not the emitter should emit color into the fluid.
- Parameters:
-
[in] |
block |
data block containing storage for the node's attributes |
- Returns:
- true if the emitter should emit color into the fluid, false
otherwise.
Intended to be called from within the emitter's
compute() method, this method retrieves the "fluidColor"
attribute value common to all fluid emitters. This specifies the
color to be added to the fluid.
- Parameters:
-
[in] |
block |
data block containing storage for the node's attributes |
- Returns:
- The color that should be emitted into the fluid.
double MPxFluidEmitterNode::fluidDropoff |
( |
MDataBlock & |
block |
) |
|
Intended to be called from within the emitter's
compute() method, this method retrieves the "fluidDropoff"
attribute value common to all fluid emitters. This specifies the
the speed with which fluid emission drops off with increasing
distance from the emitter, with higher values meaning faster
dropoff.
- Parameters:
-
[in] |
block |
data block containing storage for the node's attributes |
- Returns:
- The dropoff rate for the fluid emitter.
double MPxFluidEmitterNode::turbulence |
( |
MDataBlock & |
block |
) |
|
Intended to be called from within the emitter's
compute() method, this method retrieves the "turbulence"
attribute value common to all fluid emitters. This specifies the
amount of turbulence that should be applied to the emitter's
output.
- Parameters:
-
[in] |
block |
data block containing storage for the node's attributes |
- Returns:
- The turbulence value for the fluid emitter.
bool MPxFluidEmitterNode::fluidJitter |
( |
MDataBlock & |
block |
) |
|
Intended to be called from within the emitter's
compute() method, this method retrieves the "fluidJitter"
attribute value common to all fluid emitters. This specifies how
the voxel grid should be sampled for emission. Without jitter, the
grid is sampled only at voxel centers, but with jitter enabled,
each voxel is sampled at a random location. The fluid emitter is
responsible for implementing this behavior. It is recommended that
the random stream methods on MPxEmitterNode
be used to implement repeatable randomized behavior in this
area.
- Parameters:
-
[in] |
block |
data block containing storage for the node's attributes |
- Returns:
- true if jitter should be applied to the emission behavior,
false otherwise.