Package com.openinventor.inventor.collision

Collision Detection. Open Inventor 2.4 (and above) supports collision detection. It is now possible to manage objects and camera transformations to prevent objects from passing through (intersecting) one another. Walls are really walls: you can avoid walking through them. Solid objects are really solid: you can avoid having two of them occupy the same space at the same time.

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

Viewer Collision Detection

This method prevents the camera from going through walls or floors, making viewer manipulation much more comfortable and realistic. To use this class, first create a standard viewer and then an SoWinCollisionViewer (or SoXtCollisionViewer) for this viewer. Collision detection will be activated immediately. The minimum distance between the camera and the object can be tuned. A user callback function can be set to receive notification when a collision is detected. See SoWinCollisionViewer (or SoXtCollisionViewer) for more information. A program demonstrates how to use this class: $OIVHOME/examples/source/Inventor/examples/Features/Collision/CollisionViewer

Dual Scene Collider

SoDualSceneCollider performs very fast collision detection for the case of two scene graphs, one static, and one moving. This class is designed to detect collisions between very large scenes (i.e., containing millions of triangles) while still allowing interactive display of the two scenes. You can retrieve information about colliding triangles, coordinates of common points, and so forth. This is useful, for example, for walk-through of a complex factory environment.

The following program demonstrates how to use this class:
$OIVHOME/examples/source/Inventor/examples/Features/Collision/SceneCollider/DemoCollider.cxx

Intersection Detection Action

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 an intersection exists between two shapes, the action calls a user filter function. This function can stop the collision detection process for these two shapes.

The second step of the intersection detection mechanism consists of 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 shape or it can just say that it is not interested in the next intersection. Intersections are detected even if objects are not visible or pickable. See SoIntersectionDetectionAction for more information. A program demonstrates how to use this class: $OIVHOME/examples/source/Inventor/examples/Features/Collision/Intersections

Collision Manager

This class is deprecated and SoDualSceneCollider should be used instead.

This class is useful for monitoring the transformations of an object relative to a scene graph. It can prevent this object from colliding with other shapes in the scene, or it can glue the object to the surface of the shapes it is colliding with, or it can just call a user callback function. The gluing process tries to find the closest position where the objects do not collide. The number of positions to try can be tuned. Collision detection can be computed only on bounding boxes for the object or for all of the shapes in the scene. When a bounding box collision occurs between two shapes, a user filter function is called. This function can stop the detection process for these two shapes.

The second step of the collision detection mechanism consists of comparing each triangle of both shapes. If a triangle collision is found, the collision manager calls the user callbacks. Each callback can inform the manager if it is interested in the next collision report for the current transformation. It can be informed of the collision for the next graphic primitive (e.g. triangle or line segment) or only for the next shape or it can just say that it is not interested in the next collision reports for the current transformation. Collisions are detected even if objects are not visible or pickable. See SoCollisionManager for more information. Two programs demonstrate how to use this class: $OIVHOME/examples/source/Inventor/examples/Features/Collision/Dart and $OIVHOME/examples/source/Inventor/examples/Features/Collision/ObjectMoving