MeshSubHitRec Struct Reference

MeshSubHitRec Struct Reference

#include <mesh.h>

Class Description

This class allows access to the sub-object hit records used in Mesh hit testing.

All methods of this class are implemented by the system. SubObjHitList use Tab instead of linked-list in Max 2017 for performance of large amount of data. The constructor's change is to keep code compatibility. Although internal storage changed, client code only needs recompile without any modification.

See also
Class Mesh, Class BitArray.

Classes

struct  Iterator
 

Public Member Functions

 MeshSubHitRec (DWORD dist, int index)
 Constructor. More...
 
 MeshSubHitRec ()
 

Public Attributes

DWORD dist
 The distance of the hit. More...
 
int index
 The index of the sub-object component. More...
 
int index2
 The second level index of the sub-object component. More...
 

Constructor & Destructor Documentation

MeshSubHitRec ( DWORD  dist,
int  index 
)
inline

Constructor.

The data members are initialized to the data members passed.

Parameters
distdistance of the hit point
indexthe sub object's index
951  {
952  this->dist = dist; this->index = index;
953  index2 = -1;
954  }
DWORD dist
The distance of the hit.
Definition: mesh.h:931
int index2
The second level index of the sub-object component.
Definition: mesh.h:943
int index
The index of the sub-object component.
Definition: mesh.h:937
MeshSubHitRec ( )
inline
956 {}

Member Data Documentation

DWORD dist

The distance of the hit.

If the user is in wireframe mode, this is the distance in pixels to the item that was hit. If the user is in shaded mode, this is the Z depth distance. Smaller numbers indicate a closer hit.

int index

The index of the sub-object component.

For example, if faces were being hit tested, this would be the index of the mesh's BitArray faceSel. For edges, this is the index into the edgeSel BitArray, where the index is 3*faceIndex+edgeIndex.

int index2

The second level index of the sub-object component.

Usually it is used for MNMesh's diagonal selection, in this case the index is the poly face index while index2 is the diagonal index within the poly face.