C++ API Reference: MIntersection Class Reference
Describes the intersection of a selection hit.
More...
#include <MSelectionContext.h>
Describes the intersection of a selection hit.
This class gives a description of an intersection when a selection hit occurs.
Get the selection level of the intersection.
Parameters
[out] ReturnStatus Status code.
Returns The selection level.
Status Codes:
int index
(
MStatus *
ReturnStatus = nullptr
)
const
Get the index of the hit vertex, edge or triangle.
It is the position in the index buffer of the render item geometry when provided, and the position in the vertex buffer if not.
Parameters
[out] ReturnStatus Status code.
Returns The index of the hit vertex, edge or triangle.
Status Codes:
MStatus barycentricCoordinates
(
float &
a ,
float &
b
)
const
Get the barycentric coordinates.
Only valid for triangles. Follows Tomas Moller & Ben Trumbore, jgt 97 "Fast minimum storage ray/triangle intersection" which means that a point, T(a,b), on a triangle is given by: T(a,b) = (1-a-b)V0 + aV1 + bV2 where V0, V1, and V2 are the triangle vertices.
Parameters
[out] a The first coordinate
[out] b The second coordinate
Returns Status code
Status Codes:
float edgeInterpolantValue
(
MStatus *
ReturnStatus = nullptr
)
const
Get the edge interpolant value.
Only valid for edges. It corresponds to the intersection position on the edge, from 0 to 1 starting at V0 going to V1.
Parameters
[out] ReturnStatus Status code.
Returns The edge interpolant value.
Status Codes:
Get the intersection point in object space.
Parameters
[out] ReturnStatus Status code.
Returns The intersection point.
Status Codes:
int instanceID
(
MStatus *
ReturnStatus = nullptr
)
const
Get the draw instance ID of the render item.
Only valid for instanced render items. See MPxSubSceneOverride::addInstanceTransform
Parameters
[out] ReturnStatus Status code.
Returns The draw instance ID.
Status Codes:
const char * className
(
)
static
Returns the name of this class.
Returns Name of this class.
The documentation for this class was generated from the following files:
MSelectionContext.h
MSelectionContext.cpp