- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Friends

# MPointOnMesh Class Reference

# OpenMaya - API module for common classes

Search for all occurrences

## 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.cpp.

`#include <MMeshIntersector.h>`

List of all members.

## Public Member Functions
| MPointOnMesh ()
| Constructor.
MFloatPoint & | getPoint ()
| This method returns the point data. Search for all occurrences
MFloatVector & | getNormal ()
| 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. Search for all occurrences
int | faceIndex ()
| This method returns the face index data. Search for all occurrences
int | triangleIndex ()
| This method returns the triangle index data.
## Friends Search for all occurrences
class | MMeshIntersector Search for all occurrences

## Member Function Documentation

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

Search for all occurrences

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] | u | The relative contribution of the first vertex of the triangle.
  [out] | v | The relative contribution of the second vertex of the triangle.

MPointOnMesh MPointOnMesh MPointOnMesh MPointOnMesh MPointOnMesh MPointOnMesh MPointOnMesh MPointOnMesh MPointOnMesh MPointOnMesh
MPointOnMesh MPointOnMesh MPointOnMesh MPointOnMesh MPointOnMesh MPointOnMesh MPointOnMesh MPointOnMesh MPointOnMesh MPointOnMesh