H3D::ProximitySensor Class Reference
[Abstract nodes.]

The ProximitySensor node generates events when the viewer enters, exits, and moves within a region in space (defined by a box). More...

#include <H3D/ProximitySensor.h>

Inheritance diagram for H3D::ProximitySensor:

Inheritance graph

List of all members.

Classes

class  SetTime
 The SetBoolean class is specialize to set the value of either the enterTime or exitTime field in the ProximitySensor node it resides in, depending on the value that is is given. More...

Public Member Functions

 ProximitySensor (Inst< SFNode > _metadata=0, Inst< SFVec3f > _center=0, Inst< SFBool > _enabled=0, Inst< SFVec3f > _size=0, Inst< SFTime > _enterTime=0, Inst< SFTime > _exitTime=0, Inst< SFBool > _isActive=0, Inst< SFVec3f > _centerOfRotation_changed=0, Inst< SFRotation > _orientation_changed=0, Inst< SFVec3f > _position_changed=0)
 Constructor.
virtual void traverseSG (TraverseInfo &ti)
 Traverse function.

Public Attributes

auto_ptr< SFVec3fcenterOfRotation_changed
 centerOfRotation_changed gives the location of the center of rotation of the active viewpoint with respect to center of proximitySensor.
auto_ptr< SFVec3fposition_changed
 position_changed gives the position of the active viewpoint with respect to center of proximitySensor.
auto_ptr< SetTimeset_time
 Sets enterTime if the set_boolean value is set to TRUE else sets exitTime.
TraverseInfoprev_travinfoadr
 Adress of traverseInfo only interested in adress, what it points to will be invalid.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

The ProximitySensor node generates events when the viewer enters, exits, and moves within a region in space (defined by a box).

A proximity sensor is enabled or disabled by sending it an enabled event with a value of TRUE or FALSE. A disabled sensor does not send events. A ProximitySensor node generates isActive TRUE/FALSE events as the viewer enters and exits the rectangular box defined by its center and size fields. Browsers shall interpolate viewer positions and timestamp the isActive events with the exact time the viewer first intersected the proximity region. The center field defines the centre point of the proximity region in object space. The size field specifies a vector which defines the width (x), height (y), and depth (z) of the box bounding the region. The components of the size field shall be greater than or equal to zero. ProximitySensor nodes are affected by the hierarchical transformations of their parents.

The enterTime event is generated whenever the isActive TRUE event is generated (user enters the box), and exitTime events are generated whenever an isActive FALSE event is generated (user exits the box).

The centerOfRotation_changed field sends events whenever the user is contained within the proximity region and the center of rotation of the viewer for EXAMINE mode changes with respect to the ProximitySensor node's coordinate system. This may result when the bound Viewpoint nodes's center of rotation changes, when a new viewpoint is bound, when the user changes the center of rotation through the browser's user interface, or from changes to the ProximitySensor node's coordinate system. centerOfRotation_changed events are only generated when the currently bound NavigationInfo node includes LOOKAT navigation.

The position_changed and orientation_changed fields send events whenever the user is contained within the proximity region and the position and orientation of the viewer changes with respect to the ProximitySensor node's coordinate system including enter and exit times. The viewer movement may be a result of a variety of circumstances resulting from browser navigation, ProximitySensor node's coordinate system changes, or bound Viewpoint node's position or orientation changes.

Each ProximitySensor node behaves independently of all other ProximitySensor nodes. Every enabled ProximitySensor node that is affected by the viewer's movement receives and sends events, possibly resulting in multiple ProximitySensor nodes receiving and sending events simultaneously. Unlike TouchSensor nodes, there is no notion of a ProximitySensor node lower in the scene graph "grabbing" events. Instanced (DEF/USE) ProximitySensor nodes use the union of all the boxes to check for enter and exit. A multiply instanced ProximitySensor node will detect enter and exit for all instances of the box and send enter/exit events appropriately. For non-overlapping bounding boxes, position_changed and orientation_changed events are calculated relative to the coordinate system associated with the bounding box in which the proximity was detected. However, the results are undefined if the any of the boxes of a multiply instanced ProximitySensor node overlap.

A ProximitySensor node that surrounds the entire world has an enterTime equal to the time that the world was entered and can be used to start up animations or behaviours as soon as a world is loaded. A ProximitySensor node with a box containing zero volume (i.e., any size field element of 0.0) cannot generate events. This is equivalent to setting the enabled field to FALSE.

A ProximitySensor read from an X3D file shall generate isActive TRUE, position_changed, orientation_changed and enterTime events if the sensor is enabled and the viewer is inside the proximity region. A ProximitySensor inserted into the transformation hierarchy shall generate isActive TRUE, position_changed, orientation_changed and enterTime events if the sensor is enabled and the viewer is inside the proximity region. A ProximitySensor removed from the transformation hierarchy shall generate isActive FALSE, position_changed, orientation_changed and exitTime events if the sensor is enabled and the viewer is inside the proximity region.

Internal routes:
ProximitySensor.dot

Member Data Documentation

centerOfRotation_changed gives the location of the center of rotation of the active viewpoint with respect to center of proximitySensor.

Access type: =OutputOnly
Default value: SFVec3f = 0,0,0

ProximitySensor_centerOfRotation_changed.dot

Referenced by traverseSG().

position_changed gives the position of the active viewpoint with respect to center of proximitySensor.

Access type: =OutputOnly
Default value: SFVec3f = 0,0,0

ProximitySensor_position_changed.dot

Referenced by traverseSG().

Sets enterTime if the set_boolean value is set to TRUE else sets exitTime.

Access type: inputOnly

ProximitySensor_set_time.dot

Referenced by ProximitySensor().


The documentation for this class was generated from the following files:

Generated on Fri Nov 7 10:30:48 2008 for H3D API by  doxygen 1.5.7