public class SoVRMLTouchSensor extends SoVRMLNode
SoVRMLTouchSensor
tracks the location and state of the pointing device and detects when the user points at geometry contained by the SoVRMLTouchSensor
's parent group. This sensor can be enabled or disabled by sending it an enabled
event with a value of true or false. If the SoVRMLTouchSensor
is disabled, it does not track user input or send output events.
<font color="#0000FF">NOTE:</font> This class does not exist in Open Inventor 10.0 and later.
This section describes the expected behavior of the node in a conforming VRML97 browser application. In some cases, the application is responsible for implementing portions of the expected behavior. Open Inventor viewer classes and IVF classes implement some of the application behaviors.
This section may reference portions of the VRML97 specification that are not present in this help file. The complete VRML97 spec is available at
A SoVRMLTouchSensor
tracks the location and state of the pointing device and detects when the user points at geometry contained by the SoVRMLTouchSensor
's parent group. This sensor can be enabled or disabled by sending it an enabled
event with a value of true or false. If the SoVRMLTouchSensor
is disabled, it does not track user input or send output events.
The SoVRMLTouchSensor
generates events as the pointing device "passes over" any geometry nodes that are descendants of the SoVRMLTouchSensor
's parent group. Typically, the pointing device is a 2D device such as a mouse. In this case, the pointing device is considered to be moving within a plane a fixed distance from the viewer and perpendicular to the line of sight; this establishes a set of 3D coordinates for the pointer. If a 3D pointer is in use, then the SoVRMLTouchSensor
generates events only when the pointer is within the user's field of view. In either case, the pointing device is considered to "pass over" geometry when that geometry is intersected by a line extending from the viewer and passing through the pointer's 3D coordinates. If multiple surfaces intersect this line (hereafter called the bearing), only the nearest will be eligible to generate events.
The isOver
eventOut reflects the state of the pointing device with regard to whether it is over the SoVRMLTouchSensor
's geometry or not. When the pointing device changes state from a position such that its bearing does not intersect any of the SoVRMLTouchSensor
'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 SoVRMLTouchSensor
'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.
As the user moves the bearing over the SoVRMLTouchSensor
's geometry, the point of intersection (if any) between the bearing and the geometry is determined. Each movement of the pointing device, while isOver
is true, generates hitPoint_changed
, hitNormal_changed
, and hitTexCoord_changed
events. hitPoint_changed
events contain the 3D point on the surface of the underlying geometry, given in the SoVRMLTouchSensor
's coordinate system. hitNormal_changed
events contain the surface normal vector at the hitPoint. hitTexCoord_changed
events contain the texture coordinates of that surface at the hitPoint, which can be used to support the 3D equivalent of an image map.
If isOver
is true, the user may activate the pointing device to cause the SoVRMLTouchSensor
to generate isActive
events (e.g. press the primary mouse button). When the SoVRMLTouchSensor
generates an isActive
true event, it grabs all further motion events from the pointing device until it releases and generates an isActive
false event (other pointing device sensors will not generate events during this time). Motion of the pointing device while isActive
is true is referred to as a "drag". If a 2D pointing device is in use, isActive
events will typically reflect the state of the primary button associated with the device (i.e., isActive
is true when the primary button is pressed, and false when not released). If a 3D pointing device is in use, isActive
events will typically reflect whether the pointer is within or in contact with the SoVRMLTouchSensor
's geometry.
The eventOut field touchTime
is generated when all three of the following conditions are true:
isActive
is true),
isOver
is true),
isActive
false event is also generated).
See "Concepts - Pointing Device Sensors" for more details.
File format/default:
VRMLTouchSensor {
enabled | true |
description | "" |
metadata | NULL |
SoSFString | description_changed |
SoSFBool | enabled_changed |
SoSFVec3f | hitNormal_changed |
SoSFVec3f | hitPoint_changed |
SoSFVec2f | hitTexCoord_changed |
SoSFBool | isActive |
SoSFBool | isOver (Note: Not implemented) |
SoSFTime | touchTime |
SoSFNode | metadata_changed |
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
SoSFString |
description
Deprecated.
String that describes the sensor.
|
SoSFBool |
enabled
Deprecated.
Enables (true) or disables (false) the sensor.
|
SoSFVec3f |
hitNormal_changed
Deprecated.
Output event sent when cursor is on shape.
|
SoSFVec3f |
hitPoint_changed
Deprecated.
Output event sent when cursor on shape.
|
SoSFVec2f |
hitTexCoord_changed
Deprecated.
Output event sent when cursor on shape.
|
SoSFBool |
isActive
Deprecated.
Output event sent on button press/release.
|
SoSFBool |
isOver
Deprecated.
Output event sent when cursor on shape.
|
SoSFTime |
touchTime
Deprecated.
Output events sent on button release.
|
metadata
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoVRMLTouchSensor()
Deprecated.
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
enableEvents(boolean OnOffFlag)
Deprecated.
Enables/disables events for
all
SoVRMLTouchSensor objects. |
static boolean |
isEventsEnabled()
Deprecated.
Queries if events are enabled for all objects of this class.
|
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizable
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public final SoSFBool enabled
public final SoSFString description
public final SoSFVec3f hitNormal_changed
public final SoSFVec3f hitPoint_changed
public final SoSFVec2f hitTexCoord_changed
public final SoSFBool isActive
public final SoSFBool isOver
public final SoSFTime touchTime
public static boolean isEventsEnabled()
public static void enableEvents(boolean OnOffFlag)
SoVRMLTouchSensor
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.Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com