Use the vizproximity library to check for proximity between Vizard objects and trigger events based on proximity. There are three classes that form the foundation of this library; Sensor, Target, and Manager. A sensor object detects when a target is within its range. Sensor and target positions are based on a source object which can be a node, view, tracker, bone, matrix, or any other linkable object. A Manager object manages a collection of sensors and targets and automatically triggers events when a target enters/exits a sensor range.
The \examples\proximity folder contains additional example scripts that demonstrate how to use the vizproximity library.
The following example code creates a sensor around an avatar who begins talking when the user moves near and stops talking when the user moves away. Press the 'd' key to toggle the sensor shape debugger: