3ds Max C++ API Reference
Loading...
Searching...
No Matches
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.
 
 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.
 
HitRecordNext ()
 Each HitRecord maintains a pointer to another HitRecord.
 
CoreExport ~HitRecord ()
 Destructor.
 

Public Attributes

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

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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 

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.

5948: 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:5946
INode * nodeRef
Points to the node that was hit.
Definition: object.h:5932
ModContext * modContext
Points to the ModContext of the modifier.
Definition: object.h:5934
DWORD distance
The 'distance' of the hit. An implementation defined value that is lower for hits that are closer.
Definition: object.h:5936
ulong hitInfo
A general unsigned long value.
Definition: object.h:5940

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

5950 {
5951 next = NULL;
5952 nodeRef = nr; modContext = mc; distance = d; hitInfo = inf; hitData = hitdat;
5953 }

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

5955 {
5956 next = n;
5957 nodeRef = nr; modContext = mc; distance = d; hitInfo = inf; hitData = hitdat;
5958 }

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

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