This reference page is linked to from the following overview topics: Hit Lists.
This class provides a data structure for keeping a log of hits during sub-object hit-testing.
It provides a list of HitRecords that may be added to and cleared. A developer may also request the 'closest' hit record in the list.
#include <object.h>
Public Member Functions |
|
HitLog () | |
Constructor. |
|
~HitLog () | |
Destructor. |
|
CoreExport void | Clear () |
Clears the log of hits by deleting the list
of HitRecords. |
|
CoreExport void | ClearHitIndex (bool ready=false) |
CoreExport void | IncrHitIndex () |
HitRecord * | First () |
Implemented by the System. |
|
CoreExport HitRecord * | ClosestHit () |
Implemented by the System. |
|
CoreExport void | LogHit (INode *nr, ModContext *mc, DWORD dist, ulong info, HitData *hitdat=NULL) |
Implemented by the System. |
HitLog | ( | ) | [inline] |
Constructor.
The list of HitRecords is set to NULL.
{ first = NULL; hitIndex = 0; hitIndexReady = false; }
CoreExport void Clear | ( | ) |
Clears the log of hits by deleting the list of HitRecords.
CoreExport void ClearHitIndex | ( | bool | ready = false |
) | [inline] |
{ hitIndex = 0; hitIndexReady = ready; }
CoreExport void IncrHitIndex | ( | ) | [inline] |
{ if (hitIndexReady) hitIndex++; else hitIndexReady = true; }
HitRecord* First | ( | ) | [inline] |
CoreExport HitRecord* ClosestHit | ( | ) |
CoreExport void LogHit | ( | INode * | nr, |
ModContext * | mc, | ||
DWORD | dist, | ||
ulong | info, | ||
HitData * | hitdat =
NULL |
||
) |
Implemented by the System.
This method is called to log a hit. It creates a new HitRecord object using the data passed and adds it to the hit log.
nr | The node that was hit. |
mc | The ModContext of the modifier. |
dist | The 'distance' of the hit. What the distance actually represents depends on the rendering level of the viewport. For wireframe 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. |
info | Identifies the sub-object component that was hit. |
hitdat | If the info field is insufficient to indicate the sub-object component that was hit, pass an instance of the HitData class that contains the needed information. |