Hit Testing
 
 
 

Hit testing is the process of determining if a given point (e.g. the location of a mouse) intersects an item (for example a node, a modifier gizmo/center, or a controller gizmo). A plug-in developer's responsibility regarding hit testing depends upon the type of plug-in and how much functionality is supplied by the base class the plug-in is derived from. For example, plug-ins that are derived from SimpleObject, SimpleMod or StdControl are not required to implement methods for hit testing as it is all handled internally by the base class. Other plug-ins that don't derive from these classes (for example the Boolean object or the Mapping modifier) must perform their own hit testing, by providing an implementation of one of the following methods:

There are two types of hit testing:

There is also a distinction to be made between 'simple' hit testing and 'smart' hit testing. Simple hit testing involves finding any hit on an item. As soon as a single hit is found the process of searching for hits can stop. Smart hit testing involves finding the part of an item that was the close to the pick point. This involves hit testing everything and then searching through all the hits to find the closest one.