#include <MMeshIntersector.h>
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.
Public Member Functions | |
MPointOnMesh () | |
Constructor. | |
MFloatPoint & | getPoint () |
This method returns the point data. | |
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. More... | |
int | faceIndex () const |
This method returns the face index data. | |
int | triangleIndex () const |
This method returns the triangle index data. | |
Friends | |
class | MMeshIntersector |
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.
[out] | u | The relative contribution of the first vertex of the triangle. |
[out] | v | The relative contribution of the second vertex of the triangle. |