InteractionSelector
- Last UpdatedSep 05, 2024
- 8 minute read
The InteractionSelector node drives the user interaction with the environment inside industrial applications. It is specifically designed to interact with all the nodes of the Item hierarchy.
Typically, when there is one user, there is just one InteractionSelector node inside the application.
Platform supportThis node is fully supported on XR-Windows platform.
It is partially supported on XR-Portable Windows, XR-Portable iOS, XR-Portable Android, and XR-P WASM platforms.
Not all types of picking are supported on the portable platforms.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
Partial support |
Partial support |
Partial support |
Partial support |
|
|
|
|
|
|
Code example
This is a code example for the InteractionSelector node.
<InteractionSelector name="sel" selectionMode="@def:custom.selectionMode@"/>
Selection mode for picking items
In a manipulation based system, when selecting items in order to pick them, you can choose from several types of selection mode. For more information, see Selection modes.
Picking strategy
The InteractionSelector can apply picking strategies if the pickingStrategyNode field is populated with the name of a PickingStrategy node.
-
Can select which object type to be selectable or not. This is usually set up to includeCMesh only and incudeMWX, with other properties set to false).
-
Can use the jsonList to be able or unable to select particular nodes based on tags, IDs, or name.
Selecting the highlight style
The InteractionSelector is designed to highlight the Item instances that interact with it. Use the highlightStyle field to specify the way the highlight (silhouette) displays.
Note: The highlightStyle can be changed at runtime, but requires the selection to be deactivated and then reactivated to apply it correctly.
|
Style |
Information |
Reference Image |
|---|---|---|
|
silhouette |
Shows a clipped silhouette around the Item. |
|
|
silhouette_noZ |
Shows a silhouette around the item. The silhouette displays over everything, so it’s visible even when the Item is covered partially or completely. |
|
|
filler |
Shows a filler color over the item. The filler displays over everything, so it’s visible even when the Item is covered partially or completely. |
|
|
silhouette_noZ_filler |
Shows both a filler color and a silhouette over the item. The filler and the silhouette display over everything, so they are visible even when the Item is covered partially or completely. |
|
Configuring which Item states display the highlight
The highlightShowMode field can restrict the list of states in which an Item can display the highlight. For example, use this field to prevent selectable items from displaying highlight and providing a hint on what is active and what is not.
|
State |
Mode |
|
|
all |
selected |
|
|
Selectable |
Yes |
No |
|
Over (Blink) |
Yes |
No |
|
Selected |
Yes |
Yes |
|
Remotely Selected |
Yes |
Yes |
|
Inactive (with showSilhouetteWhenInactive=true) |
Yes |
No |
|
Debug (with _debug=true) |
Yes |
Yes |
Note: The hightlightShowMode field should be set to all value when the selectionMode is set to manipulator because similar functionalities can be achieved using the manipulatorSilhouetteMode field.
Remote actions
The InteractionSelector can display other avatar activities by setting remoteHintsVisible to true.
-
Only activities that occur inside the distance from the avatar (set by remoteHintsVisibilityDistance) appear. This lets operators understand what is happening in their vicinity.
-
The items currently selected by other avatars display a colored silhouette. The default color is blue.
-
When a user performs an action, an overhead hint appears displaying information about the selected item (group or name) and the currently running action. A line the same color as the silhouette joins the hint message with the selected item.
`
Group name conversion
The InteractionSelector has a dstring parameter named groupDisplayNames that can be used to override the name or group name of a selected item.
Guidelines
-
Item names must be unique.
-
Group parameter is used to group separate items together into a macro item.
-
Use the groupDisplayNames field to rename groups of items, even at runtime.
-
This can be useful for several purposes:
-
Having separate items or grouped items showing the same name.
For example, if a device has 30 or more screws, users might not understand why each screw requires a different name.
-
Changing the name of an item based on its state.
-
Rename an item name or item group
-
Create a dictionary pair, where:
-
Key = Old name
-
Value = New name
-
For example, a basicItem named screw35 can be renamed to Screw by inserting {screw35=Screw} in the dictionary.
InteractionSelector fields
These are the fields for InteractionSelector node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > InteractionSelector
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
actionPerformed |
mstring |
Read only |
Internally calculated |
Shows event parameters of the last action: item source, action name, action state. |
|
actionPerformedCommand |
sstring |
Optional |
Not set |
When enabled, automatically calls an external command at every item action state change with the following parameters: %0%=itself, %1%=item source, %2%=action name, %3%=action state. |
|
animationActive |
sbool |
Optional |
false |
|
|
avatar |
sstring |
Optional |
Avatar |
The name of the avatar node to which the selector is attached. |
|
avatarPickDistance |
sfloat |
Optional |
2 |
Object picking distance, in meters. |
|
getSortedActions |
sfunction |
Read only |
Returns the list of actions for the currently selected Item or Group of Items, in the form: ITEM.ACTION,ITEM.ACTION. |
|
|
groupDisplayNames |
dstring |
Optional |
Can be used to override display name or group name for groupSelected. |
|
|
groupSelected |
sstring |
Read only |
Internally calculated |
Returns the name of the currently selected item group, if any. |
|
highlightDistance |
sfloat |
Optional |
0 |
Defines maximum distance for displaying silhouette. Zero (0) means infinite distance. |
|
highlightShowMode |
senum |
Optional |
All |
Restricts the list of Item states in which to display the highlight. Select all for default behaviour or selected to restrict highlight to selected items (local, remote, and _debug). |
|
highlightStyle |
senum |
Optional |
silhouette |
Specifies the preferred highlight style from those available: silhouette, silhouette_noZ, filler, silhouette_noZ_filler. |
|
hotkeyXXDown |
sevent |
Optional |
Not set |
Can be used to route interaction selector events, such as moving the selector or pressing an hotkey. (XX = L,R,U,D,B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,B11,B12). These events are used internally and should not be involved in user scripts. |
|
hotkeyXXUp |
sevent |
Optional |
Not set |
Can be used to route interaction selector events, such as moving the selector or pressing an hotkey. (XX = L,R,U,D,B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,B11,B12). These events are used internally and should not be involved in user scripts. |
|
itemHighlighted |
sstring |
Read only |
Internally calculated |
Returns the name of the currently highlighted item, if any. An item highlighted item is a selectable item. |
|
itemSelected |
sstring |
Read only |
Internally calculated |
Returns the name of the currently selected item, if any. |
|
manipulatorSelectionMode |
senum |
Optional |
collision |
Specifies selection mode as manipulated or collision when operating in manipulation mode. |
|
manipulatorSilhouetteMode |
senum |
Optional |
All |
Defines which items show a silhouette when operating in manipulation mode. Options are None, Selected, and All. |
|
performSelection |
sevent |
Optional |
Not set |
When received, the selector sets the currently highlighted item to Selected. This is needed if selectionMode is not direct. |
|
performAction |
sstring |
Optional |
Not set |
Forces an action on the currently selected item. It requires two comma separated parameters: -action name -action state (between: start, stop, click). When action state is set to click, an additional parameter (timer) can be added. Timer enables the action to be automatically stopped after the specified time has elapsed. |
|
pickDistance |
ssfloat |
Read only |
Internally calculated |
Distance of the currently selected object. |
|
pickingStrategyNode |
sstring |
Optional |
Not set |
The name of the PickingStrategy node to apply. If not specified, no PickingStrategy is applied |
|
rayDirection |
svec3 |
Optional |
0 0 0 |
Selection ray direction. The field must be populated from outside, by an input device or other. |
|
rayLength |
ssfloat |
Optional |
1 |
Defines the ray selection picking distance in meters. Any objects farther than rayLength distance cannot be selected. When using selection rod is set to rod size. When using view ,should be set to avatarPickDistance value. |
|
rayPosition |
svec3 |
Optional |
0 0 0 |
Selection ray starting point. The field must be populated from outside, by an input device or other. |
|
remoteActionPerformed |
dstring |
Optional |
Not set |
Populated with the other avatars currently running actions. |
|
remoteHintVisible |
sbool |
Optional |
true |
When enabled, other avatar actions appear with a hint panel. The hint panel appears over an avatar and displays the item group or name and the action performed. At the same time, a colored ray connects the hint panel with the item. |
|
remoteHintVisibilityDistance |
sfloat |
Optional |
10 |
Only actions that take place within this distance can display with a hint. |
|
remoteItemSelected |
dstring |
Optional |
Not set |
Populated with the other avatars currently selected items. |
|
selectorPosition |
svec2 |
Optional |
0.5 0.5 |
The screen coordinates used to drive picking when in selectorSelection and selectorSelected modes. This field must be populated from outside. [0-1] |
|
silhouetteColor |
svec3 |
Optional |
1 1 1 |
Color for the silhouette of selectable items. |
|
silhouetteInactiveColor |
svec3 |
Optional |
0.5 0.5 0.5 |
Color for the silhouette non-selectable items. Used only when showSilhouetteWhenInactive is true. |
|
silhouetteSelectedColor |
svec3 |
Optional |
0 1 0 |
Color for the silhouette of the selected item. |
|
silhouetteDebugColor |
svec3 |
Optional |
0 1 0 |
Used inside the XR Studio. |
|
showSilhouettesWhenInactive |
sbool |
Optional |
false |
If true, silhouettes for non-active items appear. |
|
showLabelsWhenInactive |
sbool |
Optional |
false |
If true, labels for non-active items appear. |
|
selectItemFromName |
sstring |
Optional |
Not set |
Enables you to select an item by code. |
|
selected |
sfbool |
Read only |
false |
Becomes true if an item is selected. |
|
selectionMode |
senum |
Optional |
mouseSelection |
Sets the selection behavior mode. Options are: mouseSelection, avatarSelection, avatarDirect, customSelection, ray, rayDirect, selectorSelected, selectorSelection, avatarMouse, and manipulator. |
|
selectionEnable |
sbool |
Optional |
true |
When set to false, the item selection is disabled. An item can still be selected using selectItemFromName. |
|
selectionActive |
sbool |
Optional |
true |
Defines if the selector is active. Use to activate/deactivate the selection. |
|
scene |
sstring |
Optional |
Global |
Defines the scene the selector is working on. |
|
wrongAction |
sevent |
Optional |
Not set |
This event is raised when performing an action and the currently selected item has actionable set to false. |



