|The SetIsActive class is specialize field to set the isActive field. More...|
|The SetIsEnabled class is specialize to check if the primary pointing device button is pressed when the enabled field is set to true. More...|
Public Member Functions
|X3DPointingDeviceSensorNode (Inst< SFString > _description=0, Inst< SFBool > _enabled=0, Inst< SFNode > _metadata=0, Inst< SFBool > _isActive=0, Inst< SFBool > _isOver=0)|
Static Public Member Functions
|static void||updateX3DPointingDeviceSensors (Node *n)|
|Called to detect and set properties of X3DPointingDeviceSensors. |
|auto_ptr< SFString >||description|
|The description field in a X3DPointingDeviceSensorNode node specifies a textual description of the X3DPointingDeviceSensorNode node. |
|auto_ptr< SFBool >||isOver|
|The isOver field reflects the state of the pointing device with regard to whether it is pointing towards the X3DPointingDeviceSensorNode node's geometry or not. |
Static Public Attributes
|The H3DNodeDatabase for this node. |
Protected Member Functions
|virtual void||onIsOver (IntersectionInfo *result=0, Matrix4f *global_to_local=0)|
|Called to generate isOver events if they should be generated. |
Static Protected Member Functions
|static bool||has2DPointingDeviceMoved (Vec2f &pos)|
|Used to find out if the 2D pointing device ( e.g. |
|This value is used in onIsOver. |
|This value must be true for a sensor to become active. |
Pointing-device sensors detect user pointing events such as the user clicking on a piece of geometry (i.e., TouchSensor). The following node types are pointing-device sensors:
A pointing-device sensor is activated when the user locates the pointing device over geometry that is influenced by that specific pointing-device sensor. Pointing-device sensors have influence over all geometry that is descended from the sensor's parent groups. Typically, the pointing-device sensor is a sibling to the geometry that it influences. In other cases, the sensor is a sibling to groups which contain geometry (i.e., are influenced by the pointing-device sensor).
The appearance properties of the geometry do not affect activation of the sensor. In particular, transparent materials or textures shall be treated as opaque with respect to activation of pointing-device sensors.
For a given user activation, the lowest enabled pointing-device sensor in the hierarchy is activated. All other pointing-device sensors above the lowest enabled pointing-device sensor are ignored. The hierarchy is defined by the geometry node over which the pointing-device sensor is located and the entire hierarchy upward. If there are multiple pointing-device sensors tied for lowest, each of these is activated simultaneously and independently, possibly resulting in multiple sensors activating and generating output simultaneously. This feature allows combinations of pointing-device sensors (e.g., TouchSensor and PlaneSensor). If a pointing-device sensor appears in the transformation hierarchy multiple times (DEF/USE), it shall be tested for activation in all of the coordinate systems in which it appears.
If a pointing-device sensor is not enabled when the pointing-device button is activated, it will not generate events related to the pointing device until after the pointing device is deactivated and the sensor is enabled (i.e., enabling a sensor in the middle of dragging does not result in the sensor activating immediately).
The pointing device controls a pointer in the virtual world. While activated by the pointing device, a sensor will generate events as the pointer moves. Typically the pointing device may be categorized as either 2D (e.g., conventional mouse) or 3D (e.g., wand). It is suggested that the pointer controlled by a 2D device is mapped onto a plane a fixed distance from the viewer and perpendicular to the line of sight. The mapping of a 3D device may describe a 1:1 relationship between movement of the pointing device and movement of the pointer.
The position of the pointer defines a bearing which is used to determine which geometry is being indicated. When implementing a 2D pointing device it is suggested that the bearing is defined by the vector from the viewer position through the location of the pointer. When implementing a 3D pointing device it is suggested that the bearing is defined by extending a vector from the current position of the pointer in the direction indicated by the pointer.
In all cases the pointer is considered to be indicating a specific geometry when that geometry is intersected by the bearing. If the bearing intersects multiple sensors' geometries, only the sensor nearest to the pointer will be eligible for activation.
|bool X3DPointingDeviceSensorNode::has2DPointingDeviceMoved||(||Vec2f &||pos||)||
|virtual void H3D::X3DPointingDeviceSensorNode::onIsOver||(||IntersectionInfo *|| result =
|Matrix4f *|| global_to_local = |
|void X3DPointingDeviceSensorNode::updateX3DPointingDeviceSensors||(||Node *||n||)||
Called to detect and set properties of X3DPointingDeviceSensors.
This is not done in traverseSG since that would give prolems with DEF/USE feature and X3DPointingDevice hierarchy. It would also mean more calls to lineIntersect.
|n||The node to do intersection tests with, e.g. the sceneRoot.|
Referenced by H3D::H3DWindowNode::render().
This may be used by browser-specific user interfaces that wish to present users with more detailed information about the X3DPointingDeviceSensorNode.
Access type: inputOutput
Referenced by X3DPointingDeviceSensorNode().
The isOver field reflects the state of the pointing device with regard to whether it is pointing towards the X3DPointingDeviceSensorNode node's geometry or not.
When the pointing device changes state from a position such that its bearing does not intersect any of the X3DPointingDeviceSensorNode node's geometry to one in which it does intersect geometry, an isOver TRUE event is generated. When the pointing device moves from a position such that its bearing intersects geometry to one in which it no longer intersects the geometry, or some other geometry is obstructing the X3DPointingDeviceSensorNode node's geometry, an isOver FALSE event is generated. These events are generated only when the pointing device has moved and changed `over' state. Events are not generated if the geometry itself is animating and moving underneath the pointing device.
Access type: outputOnly
Referenced by X3DPointingDeviceSensorNode().
This value is used in onIsOver.
Set here instead of sending as argument cause it is more effective to go through all instances of X3DPointingDeviceSensorNodes twice than it is to compare pointers for all devices to know if it should be true or not.