H3D::PlaneSensor Class Reference
[X3D node classes.]

The PlaneSensor node maps pointing device motion into two-dimensional translation in a plane parallel to the Z=0 plane of the local coordinate system. More...

#include <H3D/PlaneSensor.h>

Inheritance diagram for H3D::PlaneSensor:

Inheritance graph

List of all members.

Classes

class  Set_PlaneEvents
 The Set_PlaneEvents field takes care of sending trackPoint_changed, translation_changed, and offset events when they should be sent. More...

Public Member Functions

 PlaneSensor (Inst< SFBool > _autoOffset=0, Inst< SFString > _description=0, Inst< SFBool > _enabled=0, Inst< SFVec2f > _maxPosition=0, Inst< SFNode > _metadata=0, Inst< SFVec2f > _minPosition=0, Inst< SFVec3f > _offset=0, Inst< SFBool > _isActive=0, Inst< SFBool > _isOver=0, Inst< SFVec3f > _trackPoint_changed=0, Inst< SFVec3f > _translation_changed=0)
 Constructor.
 ~PlaneSensor ()
 Destructor.

Public Attributes

auto_ptr< SFVec2fmaxPosition
 maxPosition can be used to clamp translation_changed events.
auto_ptr< SFVec2fminPosition
 minPosition can be used to clamp translation_changed events
auto_ptr< SFVec3foffset
 Stores the last translation_changed value at deactivation if autoOffset is true.
auto_ptr< SFVec3ftranslation_changed
 For each subsequent movement of the bearing, a translation_changed event is output which corresponds to the sum of the relative translation from the original intersection point to the intersection point of the new bearing in the plane plus the offset value.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.

Protected Member Functions

virtual void onIsOver (IntersectionInfo *result=0, Matrix4f *global_to_local=0)
 Called to generate isOver events and other events (dependent on isOver).


Detailed Description

The PlaneSensor node maps pointing device motion into two-dimensional translation in a plane parallel to the Z=0 plane of the local coordinate system.

Internal routes:
PlaneSensor.dot
The PlaneSensor node uses the descendent geometry of its parent node to determine whether it is liable to generate events.

The description field in the PlaneSensor node specifies a textual description of the PlaneSensor node. This may be used by browser-specific user interfaces that wish to present users with more detailed information about the PlaneSensor.

The enabled field enables and disables the PlaneSensor. If enabled is TRUE, the sensor reacts appropriately to user events. If enabled is FALSE, the sensor does not track user input or send events. If enabled receives a FALSE event and isActive is TRUE, the sensor becomes disabled and deactivated, and outputs an isActive FALSE event. If enabled receives a TRUE event, the sensor is enabled and made ready for user activation.

The PlaneSensor node generates events when the pointing device is activated while the pointer is indicating any descendent geometry nodes of the sensor's parent group.

Upon activation of the pointing device (e.g., mouse button down) while indicating the sensor's geometry, an isActive TRUE event is sent. Pointer motion is mapped into relative translation in the tracking plane, (a plane parallel to the sensor's local Z=0 plane and coincident with the initial point of intersection). For each subsequent movement of the bearing, a translation_changed event is output which corresponds to the sum of the relative translation from the original intersection point to the intersection point of the new bearing in the plane plus the offset value. The sign of the translation is defined by the Z=0 plane of the sensor's coordinate system. trackPoint_changed events reflect the unclamped drag position on the surface of this plane. When the pointing device is deactivated and autoOffset is TRUE, offset is set to the last translation_changed value and an offset_changed event is generated.

minPosition and maxPosition may be set to clamp translation_changed events to a range of values as measured from the origin of the Z=0 plane. If the X or Y component of minPosition is greater than the corresponding component of maxPosition, translation_changed events are not clamped in that dimension. If the X or Y component of minPosition is equal to the corresponding component of maxPosition, that component is constrained to the given value. This technique provides a way to implement a line sensor that maps dragging motion into a translation in one dimension.

While the pointing device is activated and moved, trackPoint_changed and translation_changed events are sent. trackPoint_changed events represent the unclamped intersection points on the surface of the tracking plane. If the pointing device is dragged off of the tracking plane while activated (e.g., above horizon line), browsers may interpret this in a variety ways (e.g., clamp all values to the horizon. H3DAPI resend the last event and write an error message ). Each movement of the pointing device, while isActive is TRUE, generates trackPoint_changed and translation_changed events.


Member Data Documentation

maxPosition can be used to clamp translation_changed events.

Access type: inputOutput

Default value: -1 -1

PlaneSensor_maxPosition.dot

Referenced by PlaneSensor().

minPosition can be used to clamp translation_changed events

Access type: inputOutput

Default value: 0 0

PlaneSensor_minPosition.dot

Referenced by PlaneSensor().

Stores the last translation_changed value at deactivation if autoOffset is true.

Access type: inputOutput

Default value: 0 0 0

PlaneSensor_offset.dot

Referenced by PlaneSensor().

For each subsequent movement of the bearing, a translation_changed event is output which corresponds to the sum of the relative translation from the original intersection point to the intersection point of the new bearing in the plane plus the offset value.

Access type: outputOnly

PlaneSensor_translation_changed.dot


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

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