class MMeshIntersector

Jump to documentation

Mesh intersector. (OpenMaya) (OpenMaya.py)

public members:

MMeshIntersector (void)
virtual ~MMeshIntersector (void)
MStatus create ( MObject &meshObject, const MMatrix & matrix = MMatrix::identity )
bool isCreated (void)
MStatus getClosestPoint ( MPoint & point, MPointOnMesh & meshPoint, double maxDistance = 1e38 )

Documentation

Mesh intersector. (OpenMaya) (OpenMaya.py)
Description

The MMeshIntersector class contains methods for efficiently finding the closest point to a mesh. An octree algorithm is used to find the closest point.

The create() method builds the internal data required for the algorithm. As a result, calls to it should be minimized as it is a heavy operation.

Functions

MMeshIntersector:: MMeshIntersector (void)

Description

Constructor

MMeshIntersector:: ~MMeshIntersector (void)

Description

Destructor.

MStatus MMeshIntersector:: create ( MObject &meshObject, const MMatrix & matrix )

Description

This method creates the data required by the intersector. It is a heavy operation that should be called only when necessary.

Arguments

  • meshObject a kMesh or kMeshData object
  • matrix control the space of the closest point found

Return Value

  • Status code

Status Codes

  • MS::kSuccess The mesh intersector was created
  • MS::kInvalidParameter object is not a kMesh or kMeshData
  • MS::kFailure other internal failure

bool MMeshIntersector:: isCreated (void)

Description

This method returns true if the intersector is created. False is return otherwise.

MStatus MMeshIntersector:: getClosestPoint ( MPoint & point, MPointOnMesh & meshPoint, double maxDistance )

Description

This method finds the closest point. Information is returned in the meshPoint object.

Arguments

  • point point to evaluate from. Must be in the space specified in the create method
  • meshPoint resulting closest point
  • maxDistance maximum distance to consider

Return Value

  • Status code

Status Codes

  • MS::kSuccess The mesh point was found
  • MS::kFailure object error, create not called

MPointOnMesh:: MPointOnMesh ()

Description

Constructor.

MPointOnMesh:: MPointOnMesh ( const MPointOnMesh & other )

Description

Copy constructor.

MPointOnMesh & MPointOnMesh:: operator= ( const MPointOnMesh & other )

Description

Assignment operator for MPointOnMesh.

MFloatPoint & MPointOnMesh:: getPoint ()

Description

This method returns the point data.

MFloatVector & MPointOnMesh:: getNormal ()

Description

This method returns the normal data.

int MPointOnMesh:: faceIndex ()

Description

This method returns the face index data.

int MPointOnMesh:: triangleIndex ()

Description

This method returns the triangle index data.

This class has no child classes.


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