This reference page is linked to from the following overview topics: Modifier Selection Methods, Sub-Object Hit Testing.
#include <object.h>
This class provides a data structure used during sub-object hit-testing.
Public Member Functions |
|
HitRecord () | |
Default Constructor. |
|
HitRecord (INode *nr, ModContext *mc, DWORD d, ulong inf, HitData *hitdat) | |
Constructor. |
|
HitRecord (HitRecord *n, INode *nr, ModContext *mc, DWORD d, ulong inf, HitData *hitdat) | |
Constructor. |
|
HitRecord * | Next () |
Each
HitRecord maintains a pointer to another
HitRecord. |
|
CoreExport | ~HitRecord () |
Destructor. |
|
Public Attributes |
|
INode * | nodeRef |
Points to the node that was hit. |
|
ModContext * | modContext |
Points to the
ModContext of the modifier. |
|
DWORD | distance |
The 'distance' of the hit. |
|
ulong | hitInfo |
A general unsigned long value. |
|
HitData * | hitData |
In case 4 bytes in hitInfo is not enough
space to identity the sub-object element, this pointer is
available. |
|
Friends |
|
class | HitLog |
HitRecord | ( | ) | [inline] |
HitRecord | ( | INode * | nr, |
ModContext * | mc, | ||
DWORD | d, | ||
ulong | inf, | ||
HitData * | hitdat | ||
) | [inline] |
HitRecord | ( | HitRecord * | n, |
INode * | nr, | ||
ModContext * | mc, | ||
DWORD | d, | ||
ulong | inf, | ||
HitData * | hitdat | ||
) | [inline] |
Constructor.
The data members are initialized to the data passed.
{ next = n; nodeRef = nr; modContext = mc; distance = d; hitInfo = inf; hitData = hitdat; }
HitRecord* Next | ( | ) | [inline] |
friend class HitLog [friend] |
Points to the node that was hit.
Points to the ModContext of the modifier.
DWORD distance |
The 'distance' of the hit.
To classify as a hit, the sub-object component must be within some threshold distance of the mouse. This distance is recorded in the hit record so that the closest of all the hits can be identified. What the distance actually represents depends on the rendering level of the viewport. For wire frame modes, it refers to the distance in the screen XY plane from the mouse to the sub-object component. In a shaded mode, it refers to the Z depth of the sub-object component. In both cases, smaller values indicate that the sub-object component is 'closer' to the mouse cursor.
A general unsigned long value.
Most modifiers will just need this to identity the sub-object element. The edit mesh modifier uses the value to store the index of the vertex or face that was hit for example.
In case 4 bytes in hitInfo is not enough space to identity the sub-object element, this pointer is available.
To use this, a developer would define a class derived from HitData that would contain the necessary data. The HitData class has one member function, a virtual destructor, so the derived class can be properly deleted when the HitRecord instance is deleted by the system.