CERN Accelerating science

This website is no longer maintained. Its content may be obsolete. Please visit http://home.cern/ for current CERN information.

Top

Collision Detection with Open Inventor

Open Inventor 2.4 now supports collision detection. It is now possible to manage objects and camera transformations while preventing objects to cross each other. Walls are really walls: you can avoid walking through them. Solid objects are really solid: you can avoid merging them.

Three new classes are provided to support detection of collisions in Open Inventor 2.4.

This class is an Open Inventor action. It allows programmers to analyze a complete scene graph to detect intersection between shapes. The action first detects intersection between bounding boxes. If such intersection exists between two shapes, the action calls a user filter function. This function can stop the detection process for these two shapes. The second step of the intersection detection mechanism consists in comparing each triangle of both shapes. If a triangle collision is found, the action calls the user callbacks. Each callback is able to inform the action if it is interested in the next collision report. It can be informed of the intersection for the next graphic primitive or only for the next shapes or it can just say that it is not interested in the next intersection. Intersections are detected even if objects are not visible or not pickable. See SoIntersectionDetectionAction for more information. A program demonstrates how to use this class: $OIVHOME/src/TGSdemos/ Collision/Intersection