Public Member Functions | Friends

MPointOnMesh Class Reference

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.
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.
int faceIndex ()
 This method returns the face index data.
int triangleIndex ()
 This method returns the triangle index data.

Friends

class MMeshIntersector

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.

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