3ds Max C++ API Reference
HitRecord Class Reference

This class provides a data structure used during sub-object hit-testing. More...

#include <object.h>

+ Inheritance diagram for HitRecord:

Public Member Functions

 HitRecord ()
 Default Constructor. More...
 
 HitRecord (INode *nr, ModContext *mc, DWORD d, ulong inf, HitData *hitdat)
 Constructor. More...
 
 HitRecord (HitRecord *n, INode *nr, ModContext *mc, DWORD d, ulong inf, HitData *hitdat)
 Constructor. More...
 
HitRecordNext ()
 Each HitRecord maintains a pointer to another HitRecord. More...
 
CoreExport ~HitRecord ()
 Destructor. More...
 

Public Attributes

INodenodeRef
 Points to the node that was hit. More...
 
ModContextmodContext
 Points to the ModContext of the modifier. More...
 
DWORD distance
 The 'distance' of the hit. An implementation defined value that is lower for hits that are closer. More...
 
ulong hitInfo
 A general unsigned long value. More...
 
HitDatahitData
 In case 4 bytes in hitInfo is not enough space to identity the sub-object element, this pointer is available. More...
 

Friends

class HitLog
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

This class provides a data structure used during sub-object hit-testing.

See also
Class HitLog, Class HitData

Constructor & Destructor Documentation

◆ HitRecord() [1/3]

HitRecord ( )
inline

Default Constructor.

Initializes all members to NULL.

5910 : nodeRef(NULL) { next = NULL; modContext = NULL; distance = 0; hitInfo = 0; hitData = NULL;}
#define NULL
Definition: autoptr.h:18
HitData * hitData
In case 4 bytes in hitInfo is not enough space to identity the sub-object element,...
Definition: object.h:5908
INode * nodeRef
Points to the node that was hit.
Definition: object.h:5894
ModContext * modContext
Points to the ModContext of the modifier.
Definition: object.h:5896
DWORD distance
The 'distance' of the hit. An implementation defined value that is lower for hits that are closer.
Definition: object.h:5898
ulong hitInfo
A general unsigned long value.
Definition: object.h:5902

◆ HitRecord() [2/3]

HitRecord ( INode nr,
ModContext mc,
DWORD  d,
ulong  inf,
HitData hitdat 
)
inline

Constructor.

The data members are initialized to the data passed.

5912  {
5913  next = NULL;
5914  nodeRef = nr; modContext = mc; distance = d; hitInfo = inf; hitData = hitdat;
5915  }

◆ HitRecord() [3/3]

HitRecord ( HitRecord n,
INode nr,
ModContext mc,
DWORD  d,
ulong  inf,
HitData hitdat 
)
inline

Constructor.

The data members are initialized to the data passed.

5917  {
5918  next = n;
5919  nodeRef = nr; modContext = mc; distance = d; hitInfo = inf; hitData = hitdat;
5920  }

◆ ~HitRecord()

Destructor.

If HitData has been allocated, it is deleted as well.

Member Function Documentation

◆ Next()

HitRecord* Next ( )
inline

Each HitRecord maintains a pointer to another HitRecord.

This method returns the next hit record.

5923 { return next; }

Friends And Related Function Documentation

◆ HitLog

friend class HitLog
friend

Member Data Documentation

◆ nodeRef

INode* nodeRef

Points to the node that was hit.

◆ modContext

ModContext* modContext

Points to the ModContext of the modifier.

◆ distance

DWORD distance

The 'distance' of the hit. An implementation defined value that is lower for hits that are closer.

◆ hitInfo

ulong hitInfo

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.

◆ hitData

HitData* hitData

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.