Generates events when the user moves into, out of, or within a specified region of space. More...
#include <Inventor/VRMLnodes/SoVRMLProximitySensor.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
SoVRMLProximitySensor () | |
virtual SbBool | affectsState () const |
Static Public Member Functions | |
static SoType | getClassTypeId () |
static void | enableEvents (SbBool OnOffFlag) |
static SbBool | isEventsEnabled () |
Public Attributes | |
SoSFVec3f | center |
SoSFVec3f | size |
SoSFBool | enabled |
SoSFBool | isActive |
SoSFVec3f | position_changed |
SoSFRotation | orientation_changed |
SoSFVec3f | centerOfRotation_changed |
SoSFTime | enterTime |
SoSFTime | exitTime |
The SoVRMLProximitySensor generates events when the user enters, exits, and moves within a region in space (defined by a box).
NOTE: This class does not exist in Open Inventor 10.0 and later.This section may reference portions of the VRML97 specification that are not present in this help file. The complete VRML97 spec is available at http://www.web3d.org .
The SoVRMLProximitySensor generates events when the user enters, exits, and moves within a region in space (defined by a box). A proximity sensor can be enabled or disabled by sending it an enabled event with a value of TRUE or FALSE
An SoVRMLProximitySensor generates isActive TRUE/FALSE events as the viewer enters and exits the rectangular box defined by its center and size fields. Browsers must interpolate user positions and timestamp the isActive events with the exact time the user first intersected the proximity region. The center field defines the center point of the proximity region in object space, and the size field specifies a vector which defines the width (x), height (y), and depth (z) of the box bounding the region. SoVRMLProximitySensor nodes are affected by the hierarchical transformations of its parents.
The enterTime event is generated whenever the isActive TRUE event is generated (user enters the box), and exitTime events are generated whenever isActive FALSE event is generated (user exits the box).
The position_changed and orientation_changed events send events whenever the position and orientation of the viewer changes with respect to the SoVRMLProximitySensor's coordinate system - this includes enter and exit times. Note that the user movement may be as a result of a variety of circumstances (e.g. browser navigation, proximity sensor's coordinate system changes, bound Viewpoint's position or orientation changes, or the SoVRMLProximitySensor's coordinate system changes).
Each SoVRMLProximitySensor behaves independently of all other SoVRMLProximitySensors - every enabled SoVRMLProximitySensor that is affected by the user's movement receives and sends events, possibly resulting in multiple SoVRMLProximitySensors receiving and sending events simultaneously. Unlike SoVRMLTouchSensors, there is no notion of an SoVRMLProximitySensor lower in the scene graph "grabbing" events.
Instanced (DEF/USE) SoVRMLProximitySensors use the union of all the boxes to check for enter and exit - an instanced SoVRMLProximitySensor will detect enter and exit for all instances of the box and send output events appropriately.
An SoVRMLProximitySensor that surrounds the entire world will have an enterTime equal to the time that the world was entered and can be used to start up animations or behaviors as soon as a world is loaded. A SoVRMLProximitySensor with a (0 0 0) size field cannot generate events - this is equivalent to setting the enabled field to FALSE.
center | 0 0 0 |
enabled | TRUE |
size | 0 0 0 |
metadata | NULL |
SoSFVec3f | set_center |
SoSFBool | set_enabled |
SoSFVec3f | set_size |
SoSFNode | set_metadata |
SoSFBool | isActive |
SoSFVec3f | position_changed |
SoSFRotation | orientation_changed |
SoSFVec3f | centerOfRotation_changed (Note: Not implemented) |
SoSFTime | enterTime |
SoSFTime | exitTime |
SoSFVec3f | center_changed |
SoSFBool | enabled_changed |
SoSFVec3f | size_changed |
SoSFNode | metadata_changed |
SoVRMLProximitySensor::SoVRMLProximitySensor | ( | ) |
Constructor.
virtual SbBool SoVRMLProximitySensor::affectsState | ( | ) | const [virtual] |
Returns TRUE if a node has an effect on the state during traversal.
The default method returns TRUE. Node classes (such as SoSeparator) that isolate their effects from the rest of the graph override this method to return FALSE.
Reimplemented from SoNode.
static void SoVRMLProximitySensor::enableEvents | ( | SbBool | OnOffFlag | ) | [static] |
Enables/disables events for all SoVRMLProximitySensor objects.
If you have created several objects of this class, you can disable/enable events for all of them with a single call to this method.
static SoType SoVRMLProximitySensor::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoVRMLNode.
virtual SoType SoVRMLProximitySensor::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoVRMLNode.
static SbBool SoVRMLProximitySensor::isEventsEnabled | ( | ) | [static] |
Queries if events are enabled for all objects of this class.
Output event sent when centerOfRotation changes.
Enable (TRUE) or disable (FALSE) the sensor.
Output event sent when viewer enters.
Output event sent when viewer leaves.
Output event sent when viewer enters/leaves.
Output event sent when viewer turns.
Output event sent when viewer moves.
Define the rectangular box within which isActive event is generated.