C++ API Reference
MPointOnMesh Class Reference

Mesh intersector result. More...

#include <MMeshIntersector.h>

Public Member Functions

 MPointOnMesh ()
 Constructor.
 
MFloatPointgetPoint ()
 This method returns the point data.
 
MFloatVectorgetNormal ()
 This method returns the normal data.
 
void getBarycentricCoords (float &u, float &v) const
 This method returns the barycentric coordinates of the closest point on the mesh. More...
 
int faceIndex () const
 This method returns the face index data.
 
int triangleIndex () const
 This method returns the triangle index data.
 

Friends

class MMeshIntersector
 

Detailed Description

Mesh intersector result.

This class is used to return information about a point on a mesh: 3D position, normal, barycentric coordinates, etc. Note that this can be a point anywhere on the surface of the mesh, not just at vertices.

Examples:
closestPointCmd/closestPointCmd.cpp, and splatDeformer/splatDeformer.cpp.

Member Function Documentation

void getBarycentricCoords ( float &  u,
float &  v 
) const

This method returns the barycentric coordinates of the closest point on the mesh.

If the triangle has vertices (a, b, c) then the point returned by getPoint() is at coordinates u*a + v*b + (1 - u - v)*c. The barycentric coordinates are particularly useful when interpolating attributes from one mesh to another.

Parameters
[out]uThe relative contribution of the first vertex of the triangle.
[out]vThe relative contribution of the second vertex of the triangle.

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