class MClothPolyhedron

Jump to documentation

Interface for cloth solver collision rigid body.

public members:

MClothPolyhedron ()
virtual ~MClothPolyhedron ()
virtual MStatus create ( int nVertices, int indices[][3], int nTriangles, double triDepthMap[], double triCollisionOffsetMap[], char *name = NULL, unsigned numRampSamples = 0, float* offsetVelMultiplier = NULL, float* depthVelMultiplier = NULL, double dynFrictionMultiplier = 1.0, double staticFrictionMultiplier = 1.0, bool collisionEnable = true )
virtual unsigned numVertices ( MStatus * ReturnStatus = NULL ) const
virtual unsigned numTriangles ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setPosition ( const MPointArray & postions )
virtual MStatus setPosition ( int index, const MPoint & position, int cacheNumber = 0 )
virtual MStatus getPosition ( MPointArray & postions )
virtual MStatus updateNormals ( bool init = false )
virtual MStatus updateFromMesh ( double currTime, double scale, const MObject & newMesh )
virtual MStatus updateVelocityMultiplier ( unsigned numRampSamples, float offsetVelMultiplier[], float depthVelMultiplier[] )
virtual void updateDynFrictionMultiplier ( double val )
virtual void updateStaticFrictionMultiplier ( double val )
virtual void disableCollisions ( const MIntArray &faces )
virtual void setCollisionEnable ( bool collision )
virtual void resetDisabledCollisions ()
virtual void updateDynFrictionMultiplier ( const MIntArray & faces, double val )
virtual void updateStaticFrictionMultiplier ( const MIntArray & faces, double val )
virtual void updateCollisionOffset ( double offset[] )
virtual void updateCollisionDepth ( double depth[] )
virtual void updateCollisionOffset ( const MIntArray & faces, double offset[] )
virtual void updateCollisionDepth ( const MIntArray & faces, double depth[] )
void setUserdata ( void* userPtr )
void* getUserdata ()

Documentation

Interface for cloth solver collision rigid body.
Description

This class provides access to various cloth rigid body collisions.

Functions

MClothPolyhedron:: MClothPolyhedron ()

Description

Class constructor.

MClothPolyhedron:: ~MClothPolyhedron ()

Description

Class destructor.

void MClothPolyhedron:: disableCollisions ( const MIntArray &faces )

Description

The MayaCloth plugin allows users to filter faces that are involved in a collision by using cloth sets. This method tells the rigid body to turn off collisions on the specified faces. Override this method you want to support this feature.

Arguments

  • faces - a list of faces that should be exclude from collisions.

void MClothPolyhedron:: resetDisabledCollisions ()

Description

The MayaCloth plugin allows users to filter faces that are involved in a collision by using cloth sets. This method resets any previous disabled faces on the rigid body. Override this method you want to support this feature.

MStatus MClothPolyhedron:: create ( int nVertices, int indices[][3], int nTriangles, double triDepthMap[], double triCollisionOffsetMap[], char *name, unsigned numRampSamples, float* offsetVelIncrement, float* depthVelIncrement, double dynFrictionMultiplier, double staticFrictionMultiplier, bool collisionEnable )

Description

This method creates a new cloth collision object.

Arguments

  • nVertices number of vertices.
  • indices vertex indices for the polygons.
  • nTriangles number of triangles.
  • triDepthMap triangle depth map.
  • triCollisionOffsetMap triangle collision offset map.
  • name name of this collision object.
  • numRampSamples number of ramp samples.
  • offsetVelIncrement array of offset velocity increment values.
  • depthVelIncrement array of depth velocity increment values.
  • dynFrictionMultiplier friction multiplier for rigid body
  • staticFrictionMultiplier friction multiplier for rigid body
  • collisionEnable toggle the collision state of this object

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

unsigned MClothPolyhedron:: numVertices ( MStatus * ReturnStatus ) const

Description

This method returns number of collision object vertices.

Arguments

  • ReturnStatus Status code.

Return Value

  • unsigned number of collision object vertices.

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

unsigned MClothPolyhedron:: numTriangles ( MStatus * ReturnStatus ) const

Description

This method returns number of collision object triangles.

Arguments

  • ReturnStatus Status code.

Return Value

  • unsigned number of collision object triangles.

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MClothPolyhedron:: setPosition ( const MPointArray & positions )

Description

This method sets vertex positions of all the particles for given cloth mesh.

Arguments

  • position cloth collision object position array.

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MClothPolyhedron:: setPosition ( int index, const MPoint & position, int cacheNumber )

Description

This method sets vertex position for given cloth mesh at given index.

Arguments

  • index cloth collision object index position.
  • position position point.
  • cacheNumber collision object cache index.

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MClothPolyhedron:: getPosition ( MPointArray & positions )

Description

This method returns vertex positions for cloth collision object.

Arguments

  • position cloth collision object position array

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MClothPolyhedron:: updateNormals ( bool init )

Description

This method recalculate the normals for the rigid body.

Arguments

  • init If true, need to force the complete initialization for all edge normals.

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MClothPolyhedron:: updateFromMesh ( double currTime, double scale, const MObject & newMesh )

Description

This method updates the rigid body positions from given newMesh.

Arguments

  • currTime current time frame. This can be used to cache the rigid body positions.
  • scale A scale factor to scale the position values during update.
  • newMesh A cloth mesh object.

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MClothPolyhedron:: updateVelocityMultiplier ( unsigned numRampSamples, float offsetVelMultiplier[], float depthVelMultiplier[] )

Description

This method updates the rigid body offset and depth velocity multiplier values.

Arguments

  • numRampSamples number of ramp samples.
  • offsetVelIncrement array of offset velocity increment values.
  • depthVelIncrement array of depth velocity increment values.

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

void MClothPolyhedron:: updateDynFrictionMultiplier ( double val )

Description

This method updates the rigid body dynamic friction multiplier.

Arguments

  • val The new friction multiplier value.

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

void MClothPolyhedron:: updateStaticFrictionMultiplier ( double val )

Description

This method updates the rigid body static friction multiplier.

Arguments

  • val The new friction multiplier value.

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

void MClothPolyhedron:: updateDynFrictionMultiplier ( const MIntArray & faces, double val )

Description

This method updates the rigid body dynamic friction multiplier for a select set of faces.

Arguments

  • faces The indices of faces to update.
  • val The new friction multiplier value.

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

void MClothPolyhedron:: updateStaticFrictionMultiplier ( const MIntArray & faces, double val )

Description

This method updates the rigid body static friction multiplier for a given set of faces.

Arguments

  • faces The indices of faces to update.
  • val The new friction multiplier value.

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

void MClothPolyhedron:: setCollisionEnable ( bool collision )

Description

This method enables cloth collision against collision geometry.

Arguments

  • collision The flag to enable or disable collision

void MClothPolyhedron:: updateCollisionOffset ( double offset[] )

Description

This method sets the collision offset for all the vertices of the collision geometry.

Arguments

  • offset The input array with the given offset values

void MClothPolyhedron:: updateCollisionDepth ( double depth[] )

Description

This method sets the collision depth for all the vertices of the collision geometry.

Arguments

  • depth The input array with the given depth values

void MClothPolyhedron:: updateCollisionOffset ( const MIntArray & faces, double offset[] )

Description

This method sets the collision offset for all the given faces of the collision geometry.

Arguments

  • faces The array that stores the face indices
  • offset The input array with the given offset values

void MClothPolyhedron:: updateCollisionDepth ( const MIntArray & faces, double depth[] )

Description

This method sets the collision depth for all the given faces of the collision geometry.

Arguments

  • faces The array that stores the face indices
  • depth The input array with the given depth values

void MClothPolyhedron:: updateCollisionOffset ( double deptht[] )

Description

This method sets the collision depth for all the vertices of the collision geometry.

Arguments

  • depth The input array with the given depth values

void MClothPolyhedron:: setUserdata (void *userDataPtr)

Description

Internal use only Set user data for CpClothSolver plugin.

Arguments

  • userDataPtr The userDataPtr to set.

void* MClothPolyhedron:: getUserdata ()

Description

Internal use only Return user data to CpClothSolver plugin.

Return Value

  • userDataPtr The userDataPtr associated with this object.

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright