3ds Max C++ API Reference
MeshSubHitRec Struct Reference

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

#include <mesh.h>

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

Detailed 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.

Constructor & Destructor Documentation

◆ MeshSubHitRec() [1/2]

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
952  {
953  this->dist = dist; this->index = index;
954  index2 = -1;
955  }
int index2
The second level index of the sub-object component.
Definition: mesh.h:944
int index
The index of the sub-object component.
Definition: mesh.h:938
DWORD dist
The distance of the hit.
Definition: mesh.h:932

◆ MeshSubHitRec() [2/2]

MeshSubHitRec ( )
inline
957 {}

Member Data Documentation

◆ dist

DWORD dist

The distance of the hit.

An implementation defined value that is lower for hits that are closer.

◆ index

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.

◆ index2

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.