The SoIntersectionDetectionAction class is for detecting intersecting primitives in a scene.

Note that only collisions between actual geometry in the scene is detected, so the contents of some special nodes like e.g. SoText2 and SoImage (which projects to screen-plane bitmap graphics, and not actual polygons) will not be considered for collision detection.

Note also that the SoIntersectionDetectionAction class is not a high-performance component in Coin. Using it in a continuous manner over complex scene graphs is doomed to be a performance killer.

Below is a simple usage example for this class. It was written as a stand-alone framework set up for profiling and optimization of the SoIntersectionDetectionAction. It tests intersection of all shapes against each other for the loaded file.

For application programmers wanting to extend the library with new actions: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through Inventor/nodes/SoSubAction.h: SO_ACTION_SOURCE, SO_ACTION_INIT_CLASS and SO_ACTION_CONSTRUCTOR.

For more information on writing Coin extensions, see the SoAction class documentation.

Returns the actual type id of an object derived from a class inheriting SoAction. Needs to be overridden in all subclasses.

This makes primitives within the epsilon distance be considered to intersect each other.

This will affect all intersection detection action objects in use that don't have a locally set value.

The epsilon value is a worldspace value.

Be aware that increasing the epsilon value can dramatically increase the number of primitive intersection tests being done to decide intersections. Increasing the epsilon value can therefore cause serious slow-downs in the running time of the intersections checks.

Returns whether nodes of specific types are enabled or not. The checkgroups argument can be set to TRUE if you wan't the return value to reflect whether the node will be implicit enabled/disabled through the settings controlled by the setManipsEnabled() and setDraggersEnabled() functions.

The default is that all node types are enabled.

Note that derivation checks are not performed - the type needs to be the exact same type as has been disabled with setTypeEnabled()

Note that an SoPath will also contain all nodes that may influence e.g. geometry nodes in the path. So for instance applying an SoGLRenderAction on an SoPath will render that path as expected in the view, where geometry will get its materials, textures, and other appearance settings correctly.

If the path ends in an SoGroup node, the action will also traverse the tail node's children.

Applies action to the graphs defined by pathlist. If obeysrules is set to TRUE, pathlist must obey the following four conditions (which is the case for path lists returned from search actions for non-group nodes and path lists returned from picking actions):

All paths must start at the same head node. All paths must be sorted in traversal order. The paths must be unique. No path can continue through the end point of another path.

This callback is called when two shapes are found to have intersecting bounding boxes, and are about to be checked for real intersection between their primitives.

When intersection epsilon values are in use, bounding box intersection testing is done approximately and will trigger the filter callback on boxes that are further from each other than the epsilon length.

If the callback returns TRUE, the intersection test will be performed. If the callback returns FALSE, the intersection testing will be skipped.

Adds a callback to be called when two intersecting primitives are found in the scene.

If the callback returns ABORT, the intersection detection is aborted. If the callback returns NEXT_SHAPE, the intersection detection between these two shapes are aborted and the action continues checking other shapes. If the callback returns NEXT_PRIMITIVE, the intersection detection testing continues checking the other primitives in these two shapes.