C++ API Reference

Class for wrapping N cloth objects. More...

#include <MnRigid.h>

+ Inheritance diagram for MnRigid:

Public Member Functions

 MnRigid ()
 Default constructor. More...
 
 ~MnRigid () override
 The class destructor.
 
MStatus setTopology (const int numFaces, int *numVertsPerFace, int *faces, const int numEdges, int *edges)
 sets the topology of the underlying N Object. More...
 
MStatus createNRigid ()
 Creates the underlying Maya TnRigid and sets this class to wrap it. More...
 
MStatus setPositions (const MFloatPointArray &positions, bool startFrame=true)
 Sets the positions of the vertices of the underlying nRigid object. More...
 
MStatus setVelocities (const MFloatPointArray &velocities)
 Sets the velocities of the vertices of the underlying nRigid object. More...
 
MStatus setThickness (float radius)
 sets a radius on each point of the mesh for collision purposes. More...
 
MStatus setThickness (float *radius)
 sets a radius (thickness) on a per point basis for the mesh for collision purposes. More...
 
MStatus setBounce (float bounce)
 sets the bounce for every point in this mesh More...
 
MStatus setBounce (float *bounce)
 sets the bounce on a per point basis in this mesh More...
 
MStatus setFriction (float friction)
 sets the friction for every point in this mesh More...
 
MStatus setFriction (float *friction)
 sets the friction on a per point basis for this mesh More...
 
MStatus setCollisionFlags (const bool vertToVert, const bool edgeToEdge=false, const bool faceToFace=false)
 Sets how (or if) this object will collide with other objects. More...
 
MStatus getNumVertices (unsigned int &numVerts) const
 Returns the number of vertices in the underlying nRigid. More...
 
MStatus getPositions (MFloatPointArray &positions) const
 gets the positions of the points of the underlying N Object. More...
 
MStatus getVelocities (MFloatPointArray &velocities) const
 gets the velocities of the points of the underlying nRigid object. More...
 
MStatus getThickness (MFloatArray &radius) const
 gets the thickness at each point of the underlying N rigid object. More...
 
MStatus getInverseMass (MFloatArray &inverseMass) const
 gets the inverseMass at each point of the underlying N rigid object. More...
 
MStatus getBounce (MFloatArray &bounce) const
 gets the bounce at each point of the underlying N rigid object. More...
 
MStatus getFriction (MFloatArray &friction) const
 gets the friction at each point of the underlying N rigid object. More...
 
- Public Member Functions inherited from MnObject
 MnObject ()
 Default constructor. More...
 
virtual ~MnObject ()
 The class destructor.
 

Protected Member Functions

void setNRigid (TnRigid *nObj, bool own)
 Sets the TnRigid pointer which this class wraps. More...
 
- Protected Member Functions inherited from MnObject
void setNObject (TnObject *nObj, bool own)
 Sets the TnObject pointer which this class wraps. More...
 

Detailed Description

Class for wrapping N cloth objects.

This class wraps the internal Maya representation of N cloth objects suitable for use with the Nucleus solver.

Examples:
testNpassiveNode/testNpassiveNode.h.

Constructor & Destructor Documentation

MnRigid ( )

Default constructor.

The parent class will set the instance to contain nothing.

Member Function Documentation

MStatus setTopology ( const int  numFaces,
int *  numVertsPerFace,
int *  faces,
const int  numEdges,
int *  edges 
)

sets the topology of the underlying N Object.

Before calling other methods, this must be the first method you call once the rigid object is created.

Parameters
[in]numFacesnumber of faces
[in]numVertsPerFacean array of size numFaces, where each element describes the number of verts on that face
[in]facesan array containing the actual face description. Each element is a vertex index.
[in]numEdgesnumber of edges
[in]edgesan array containing the edge description. Each element is a vertex index.
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus createNRigid ( )

Creates the underlying Maya TnRigid and sets this class to wrap it.

Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus setPositions ( const MFloatPointArray positions,
bool  startFrame = true 
)

Sets the positions of the vertices of the underlying nRigid object.

Parameters
[in]positionsthe array containing the position information
[in]startFramewhether this information represents the state of the object at the start frame.
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus setVelocities ( const MFloatPointArray velocities)

Sets the velocities of the vertices of the underlying nRigid object.

Parameters
[in]velocitiesthe array containing the velocity information
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus setThickness ( float  radius)

sets a radius on each point of the mesh for collision purposes.

The bigger the radius/thickness, the more easily things collide.

Parameters
[in]radiusthe radius to set
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus setThickness ( float *  radius)

sets a radius (thickness) on a per point basis for the mesh for collision purposes.

The bigger the radius, the more easily things collide.

Parameters
[in]radiusthe radius to set
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus setBounce ( float  bounce)

sets the bounce for every point in this mesh

Parameters
[in]bouncevalue of bounce to set
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus setBounce ( float *  bounce)

sets the bounce on a per point basis in this mesh

Parameters
[in]bouncevalue of bounce to set
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus setFriction ( float  friction)

sets the friction for every point in this mesh

Parameters
[in]frictionthe friction to set
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus setFriction ( float *  friction)

sets the friction on a per point basis for this mesh

Parameters
[in]frictionthe friction to set
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus setCollisionFlags ( const bool  vertToVert,
const bool  edgeToEdge = false,
const bool  faceToFace = false 
)

Sets how (or if) this object will collide with other objects.

Parameters
[in]vertToVertwhether to calculate vertex - vertex collisions
[in]edgeToEdgewhether to calculate edge - edge collisions
[in]faceToFacewhether to calculate face - face collisions
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus getNumVertices ( unsigned int &  numVerts) const

Returns the number of vertices in the underlying nRigid.

Parameters
[out]numVertsNumber of vertices.
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus getPositions ( MFloatPointArray positions) const

gets the positions of the points of the underlying N Object.

Parameters
[out]positionsthe array will be filled with the positions.
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus getVelocities ( MFloatPointArray velocities) const

gets the velocities of the points of the underlying nRigid object.

Parameters
[in]velocitiesthe array will be filled with the positions.
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus getThickness ( MFloatArray radius) const

gets the thickness at each point of the underlying N rigid object.

Parameters
[in]radiusthe array will be filled with the thickness.
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus getInverseMass ( MFloatArray inverseMass) const

gets the inverseMass at each point of the underlying N rigid object.

Parameters
[in]inverseMassthe array will be filled with the inverse masses.
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus getBounce ( MFloatArray bounce) const

gets the bounce at each point of the underlying N rigid object.

Parameters
[in]bouncethe array will be filled with the bounce.
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
MStatus getFriction ( MFloatArray friction) const

gets the friction at each point of the underlying N rigid object.

Parameters
[in]frictionthe array will be filled with the friction.
Returns
  • MS::kSuccess the operation was completed successfully
  • MS::kFailure the operation failed
void setNRigid ( TnRigid *  nObj,
bool  own 
)
protected

Sets the TnRigid pointer which this class wraps.

If own is true, then the TnRigid will be deleted when this class is destroyed.


The documentation for this class was generated from the following files: