Home | Hierarchy | Members | Alphabetical | Related Pages |
#include <proximitysensor.h>
Inherits Node.
Inheritance diagram for ProximitySensor:
Public Member Functions | |
ProximitySensor (const char *name="") | |
virtual | ~ProximitySensor () |
virtual unsigned int | nbFields () const |
virtual FieldHandle | field (const std::string &n) |
virtual FieldHandle | field (const unsigned int i) |
virtual bool | isSetToDefaultValue (const unsigned int i) const |
virtual unsigned int | nbEventsIn () const |
virtual EventInHandle | eventIn (const std::string &n) |
virtual EventInHandle | eventIn (const unsigned int i) |
virtual unsigned int | nbEventsOut () const |
virtual EventOutHandle | eventOut (const std::string &n) |
virtual EventOutHandle | eventOut (const unsigned int i) |
const char * | typeName () const |
virtual Node * | duplicate () const |
virtual Node * | duplicate (std::map< const Node *, Node * > &) const |
Public Attributes | |
Exposed Fields | |
A field that is capable of receiving events via an eventIn to change its value(s), and generating events via an eventOut when its value(s) change. | |
SFVec3f | center |
SFVec3f | size |
SFBool | enabled |
Events In | |
EventIn< SFVec3f > | set_center |
EventIn< SFVec3f > | set_size |
EventIn< SFBool > | set_enabled |
Events Out | |
EventOut< SFBool > | isActive |
EventOut< SFVec3f > | position_changed |
EventOut< SFRotation > | orientation_changed |
EventOut< SFTime > | enterTime |
EventOut< SFTime > | exitTime |
EventOut< SFVec3f > | center_changed |
EventOut< SFVec3f > | size_changed |
EventOut< SFBool > | enabled_changed |
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 position_changed and orientation_changed eventOuts 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. 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 a VRML 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.
|
Construct a node with all its fields set to default value, which is equivalent to the code below: |
|
Virtual destructor, does nothing |
|
Implements Node. |
|
Returns a deep copy of this node, that is a fully independant node with all children (if any) also copied. This is mainly useful for instanciating protos. Implements Node. |
|
Return a handle on the Implements Node. |
|
Return a handle on the event in named
Implements Node. |
|
Return a handle on the
Implements Node. |
|
Return a handle on the event out named
Implements Node. |
|
Return a handle on the
Implements Node. |
|
Return a handle on the field named
Implements Node. |
|
Implements Node. |
|
Returns the number of events in for this node type. Implements Node. |
|
Returns the number of events out for this node type. Implements Node. |
|
Returns the number of fields (exposed or not) for this node type. Implements Node. |
|
Returns Implements Node. |
|
See Detailed Description for meaning of this field. Default value is set to center.setXYZ(0,0,0); |
|
Changed event associated to exposedField center |
|
See Detailed Description for meaning of this field. Default value is set to enabled = true; |
|
Changed event associated to exposedField enabled |
|
See Detailed Description for meaning of this event. |
|
See Detailed Description for meaning of this event. |
|
See Detailed Description for meaning of this event. |
|
See Detailed Description for meaning of this event. |
|
See Detailed Description for meaning of this event. |
|
Set event associated to exposedField center |
|
Set event associated to exposedField enabled |
|
Set event associated to exposedField size |
|
See Detailed Description for meaning of this field. Default value is set to size.setXYZ(0,0,0); |
|
Changed event associated to exposedField size |
Generated on 24 Feb 2005 with version 1.3.9.1. |