How Collision Detection Works

You may have GraphWorX64 displays that represent complex reproductions of a dynamic work environment. To create such an environment, you use any number of dynamics that make GraphWorX64 objects appear to move during runtime. Oftentimes, it is easy to make sure that dynamic objects do not collide at runtime, but in a complex three-dimensional system with many moving parts, collisions are not always easy to anticipate.

 

While the collision of simulated objects in a console or runtime display may not affect your live production environment, it can be a distraction to runtime operators who witness a simulated collision in their runtime consoles. Collision detection is a test of dynamic and animated objects in a 3D viewport of a GraphWorX64 display. It tests any objects, dynamic or static, that you believe could collide in a 3D GraphWorX64 display. For example, if the display simulates a system of conveyors and robot arms, you can test:

How you set up collision detection is described in Setting Up and Running a Collision Test. An alternate set of steps is also available in the Collision Detection in 3D - Quick Start topic. Before you set up a test, you should understand how collision detection works.

The Limitations of Collisions

The collision detection test is only interested in the geometries of registered objects and doesn’t know anything else about them. Collision detection doesn’t even know about the location, rotation, and size dynamics that are associated with objects. It simply reads the current geometries of the registered objects in each rendering loop and tries to find a collision between them. When it finds a collision, it reports that collision using TraceWorX, GenEvents, or by changing the color of objects in the display when they collide. (These options are available to you in the Collision Detection dialog box where you set up your collision test, and are described in the Collision Detection Section of the 3D Advanced Ribbon topic.)

 

The collision test recognizes collisions as literal events; it does not take into consideration any additional dynamics associated with colliding objects. For example, a GraphWorX64 display may have two colliding objects that also have visibility dynamics associated with them. (Visibility dynamics are: the Color dynamic, the Hide dynamic, and the Disable dynamic). Collision detection does not consider an object's visibility when detecting collisions and therefore triggers a collision event even if an object is hidden by a visibility dynamic. The same is true for state and range selectors; you may decide that a collision with object that has a state or range selector may not ever occur.

 

You can overcome this condition by writing a GraphWorX64 script that tests for aspects (such as the visibility) of colliding objects and attach the script to the CollisionStateSet script that is provided with the collision detection feature. This script and other features of collision detection are described in more detail in the Collision Detection Section of the 3D Advanced Ribbon topic.

 

See also:

Collision Detection Section of the 3D Advanced Ribbon

Collision Detection TraceWorX Trace Log

Collision Detection GenEvents

Collision Detection in 3D - Quick Start

Setting Up and Running a Collision Test