vrImmersiveInteractionService

class vrImmersiveInteractionService

(Inherits vrBaseService)

This service allows the management of all immersive device interactions that are built into VRED. It contains methods to activate or deactivate these interactions and to adjust their settings.

Summary

Functions:
Signals:

Functions

vrImmersiveInteractionService.activateGroundCalibrationMode(rightHand)

Start ground calibration.

Parameters:rightHand (bool) –
vrImmersiveInteractionService.createMultiMarker(multiMarkerName, markerNames, markerType)

Creates a multi marker by averaging the pose of multiple regular markers.

Parameters:
  • multiMarkerName (string) – The name the multi marker will have. Can be chosen freely
  • markerNames (List[string]) – The names of the marker the multi marker will consist of
  • markerType (vrXRealityTypes.MarkerTypes) – The type of the markers the multi marker will consist of
Returns:

Return type:

vrdMultiMarker

vrImmersiveInteractionService.getActiveHMDSupportsHandTracking()
Returns:True, if hand tracking is supported
Return type:bool
vrImmersiveInteractionService.getAutoCreateCollisionObjects()

Returns whether collision objects are automatically created.

Returns:true if collision objects are automatically created.
Return type:bool
vrImmersiveInteractionService.getControllerVisualizationMode()

Returns the current controller visualization mode.

Returns:Current visualization mode
Return type:vrVRInputDeviceTypes.VisualizationMode
vrImmersiveInteractionService.getControlMode()

Returns the current control mode.

Returns:Current control mode
Return type:vrImmersiveInteractionTypes.ControlMode
vrImmersiveInteractionService.getDetectedMarkers(markerType)

Gets all detected markers of a given type.

Parameters:markerType (vrXRealityTypes.MarkerTypes) – The type of the marker
Returns:The detected markers
Return type:List[vrdMarker]
vrImmersiveInteractionService.getHandTrackingEnabled()
Returns:True, if hand tracking is enabled
Return type:bool
vrImmersiveInteractionService.getHandTrackingOffset()
Returns:The tracking offset from the head to the tracker
Return type:QMatrix4x4
vrImmersiveInteractionService.getHandTrackingType()
Returns:The current hand tracking type
Return type:vrHandTypes.HandTrackingType
vrImmersiveInteractionService.getMarker(name, markerType)

Gets a marker that has already been detected.

Parameters:
Returns:

The marker or a null marker if the name and type combination is undetected

Return type:

vrdMarker

vrImmersiveInteractionService.getMinMarkerConfidence()

See also: setMinMarkerConfidence.

Returns:The minimum marker confidence
Return type:float
vrImmersiveInteractionService.getPointerRayScaleRange()
Returns:Pointer ray scale range [min, max]. A value of 1.0 equals 100 percent scaling.
Return type:QVector2D
vrImmersiveInteractionService.getPointerScalingDistance()
Returns:Pointer scaling distance in scene units
Return type:float
vrImmersiveInteractionService.getPointerSphereScaleRange()
Returns:Pointer sphere scale range [min, max]. A value of 1.0 equals 100 percent scaling.
Return type:QVector2D
vrImmersiveInteractionService.getPreferredTooltipsMode()

Returns whether to show tooltips on start.

Returns:true if tooltips must show
Return type:bool
vrImmersiveInteractionService.getRelativeTeleportOrientation()

Returns if the angle of the orientation is taken from the wrists absolute or relative rotation.

Returns:Flag indicating if relative rotation should be used or not
Return type:bool
vrImmersiveInteractionService.getShowTrackedHandsInMR()
Returns:True, if the tracked hands visualization is shown in mixed reality mode
Return type:bool
vrImmersiveInteractionService.getTeleportAvailability()

Gets in which render modes the teleport is available.

Returns:The supported modes
Return type:List[vrXRealityTypes.XRRenderMode]
vrImmersiveInteractionService.getTeleportGroundHeight()

Returns the height of the ground plane used in “On Ground Plane” teleport mode.

Returns:Ground height in scene units
Return type:float
vrImmersiveInteractionService.getTeleportGroundMode()

Returns the current teleport ground mode.

Returns:Ground mode
Return type:vrImmersiveInteractionTypes.TeleportGroundMode
vrImmersiveInteractionService.getTeleportRange()

Returns the maximum teleport distance.

Returns:Maximum distance in scene units
Return type:float
vrImmersiveInteractionService.getUseBoundingBoxCollisionObjects()

Returns whether bounding box colliders are used for automatically created collision objects.

Returns:true if bounding box colliders are used, false if convex hull colliders are used
Return type:bool
vrImmersiveInteractionService.hideControllerMessage(message)

Hide a controller message.

Parameters:message (vrdNode) – The vrdNode of the message.
vrImmersiveInteractionService.isHandTrackingGestureEnabled(gesture, leftHand)

Get if VRED detects a hand gesture while hand tracking is active.

Parameters:
  • gesture (vrHandTypes.HandTrackingGesture) – The gesture to check
  • leftHand (bool) – True for gesture on the left hand, False for a gesture on the right hand
Returns:

True if the gesture is enabled, False otherwise

Return type:

bool

vrImmersiveInteractionService.isHmdActive()

Check if an HMD (VR) display mode is active.

Returns:True, if in HMD mode
Return type:bool
vrImmersiveInteractionService.pickingMoved(hit)

Triggers a pointer move event.

Parameters:hit (vrdRayIntersection) – ray intersection object.
vrImmersiveInteractionService.pickingPressed(hit)

Triggers a pointer button pressed event.

Parameters:hit (vrdRayIntersection) – ray intersection object.
vrImmersiveInteractionService.pickingReleased(hit)

Triggers a pointer button released event.

Parameters:hit (vrdRayIntersection) – ray intersection object.
vrImmersiveInteractionService.setAutoCreateCollisionObjects(automatic)

Toggles collision object creation for touch-sensors and web-engines.

Parameters:automatic (bool) – Enable automatic creation.
vrImmersiveInteractionService.setControllerVisualizationMode(mode)

Sets the visualization mode for the HMD controllers.

Parameters:mode (vrVRInputDeviceTypes.VisualizationMode) – The visualization mode
vrImmersiveInteractionService.setControlMode(mode)

Sets the controle mode and corresponding button mappings for the immersive interactions.

Parameters:mode (vrImmersiveInteractionTypes.ControlMode) – The control mode
vrImmersiveInteractionService.setDefaultInteractionsActive(active)

Activates or deactivates all built-in interaction tools (teleport, pointer).

Parameters:active (bool) – True to activate, False to deactivate.
vrImmersiveInteractionService.setHandTrackingEnabled(value)

Use hand tracking device instead of VR controllers.

Parameters:value (bool) – If True, use hand tracking device
vrImmersiveInteractionService.setHandTrackingGestureEnabled(gesture, leftHand, enable)

Set if VRED should detect a hand gesture while hand tracking is active.

Parameters:
  • gesture (vrHandTypes.HandTrackingGesture) – The gesture to enable or disable
  • leftHand (bool) – True for gesture on the left hand, False for a gesture on the right hand
  • enable (bool) – True to enable the gesture, False to disable it
vrImmersiveInteractionService.setHandTrackingOffset(offset)

The mounting point of the tracking device on the HMD.

Parameters:offset (QMatrix4x4) – a matrix describing the transformation from HMD to tracker
vrImmersiveInteractionService.setHandTrackingType(type)

Sets the hand tracking device type that should be used.

Parameters:type (vrHandTypes.HandTrackingType) – The tracking device to use
vrImmersiveInteractionService.setInteractionActive(name, active)

Activates or deactivates the specified interaction tool. Built-in interactions are named “Teleport”, “Pointer”.

Parameters:
  • name (string) – Interaction identifier
  • active (bool) – True to activate, False to deactivate.
vrImmersiveInteractionService.setMarkerTrackingType(markerIds, trackingType)

See also: vrdMarker.setTrackingType.

Parameters:
  • markerIds (List[integer]) – The marker ids for which the tracking type will be set
  • trackingType (vrXRealityTypes.MarkerTrackingTypes) – The type of tracking that is used for the marker. Use predicted for markers that are moved and static for markers that stay in place.
vrImmersiveInteractionService.setMinMarkerConfidence(confidence)

Sets the minimum marker confidence. When markers are detected with a lower confidence they will be ignored. Markers that are already known to the system will not be updated, if the updated data has a lower confidence.

Parameters:confidence (float) – The minimum confidence
vrImmersiveInteractionService.setPointerRayScaleRange(value)

Sets a minimum and maximum scale value for the pointer ray. A value of 1.0 equals 100 percent scaling.

Parameters:value (QVector2D) – Scale range [min, max] floating point values.
vrImmersiveInteractionService.setPointerScalingDistance(value)

Sets the distance at which the pointer scaling is 100 percent.

Parameters:value (float) – Scaling distance in scene units
vrImmersiveInteractionService.setPointerSphereScaleRange(value)

Sets a minimum and maximum scale value for the pointer sphere. A value of 1.0 equals 100 percent scaling.

Parameters:value (QVector2D) – Scale range [min, max] floating point values.
vrImmersiveInteractionService.setPreferredControllerVisualizeMode(mode)

Toggles the default visualisation style for the hands.

Parameters:mode (vrVRInputDeviceTypes.VisualizationMode) – Enable hands or controllers
vrImmersiveInteractionService.setPreferredTooltipsMode(show)

Toggles whether to show tooltips when the session starts.

Parameters:show (bool) – Show tooltips.
vrImmersiveInteractionService.setRelativeTeleportOrientation(isRelative)

Sets if the angle of the orientation is taken from the wrists absolute or relative rotation.

Parameters:isRelative (bool) – indicating if relative rotation should be used or not
vrImmersiveInteractionService.setShowTrackedHandsInMR(showHands)

Set if VRED should show the tracked hands visualization in mixed reality mode.

Parameters:showHands (bool) – True, if the hands should be shown, False otherwise
vrImmersiveInteractionService.setTeleportAvailability(modes)

Sets in which render modes the teleport is available.

Parameters:modes (List[vrXRealityTypes.XRRenderMode]) – The modes for which teleport is activated per default.
vrImmersiveInteractionService.setTeleportGroundHeight(height)

Sets the height of the ground plane for the “On Ground Plane” teleport mode.

Parameters:height (float) – Height in scene units
vrImmersiveInteractionService.setTeleportGroundMode(mode)

Sets whether to teleport on scene geometries, or to teleport only on a virtual ground plane.

Parameters:mode (vrImmersiveInteractionTypes.TeleportGroundMode) – Ground mode
vrImmersiveInteractionService.setTeleportRange(range)

Sets the maximum teleport distance.

Parameters:range (float) – Maximum distance in scene units
vrImmersiveInteractionService.setUseBoundingBoxCollisionObjects(useBoundingBox)

Enable bounding box colliders for automatically created collision objects.

This is useful for performance reasons, as bounding box colliders are faster to calculate than the default convex hull colliders but are less accurate.

Parameters:useBoundingBox (bool) – true to enable bounding box colliders, false to use convex hull colliders
vrImmersiveInteractionService.setViewpointMode(adjustHeight, adjustOrientation=True, adjustPosition=True)

Changes the default behavior for viewpoint selection. The actual camera position is the transformation of a viewpoint plus the transformation of the hmd. If adjustment is enabled, the camera position is modified in a way, that the resulting camera plus hmd position matches exaclty a viewpoint position, height or orientation.

Parameters:
  • adjustHeight (bool) – If True, user is moved to the height of the viewpoint.
  • adjustOrientation (bool) – If True, user is orientated in the direction of the viewpoint.
  • adjustPosition (bool) – If True, user is moved to the position of the viewpoint.
vrImmersiveInteractionService.showControllerMessage(data, rightHand)

Show a controller message depending on the provided data.

Parameters:
  • data (vrdDeviceMessageData) – Message data.
  • rightHand (bool) – Show it on the right or left hand.
Returns:

vrdNode of the message.

Return type:

vrdNode

Signals

vrImmersiveInteractionService.automaticCollisionObjectCreationChanged(automatic)

Notifies about changed automatic collision-object creation preference.

Parameters:automatic (bool) – new preference
vrImmersiveInteractionService.controllerVisualizationModeChanged(mode)

Notifies about changed hand visualisation style.

Parameters:mode (vrVRInputDeviceTypes.VisualizationMode) – New visualisation style
vrImmersiveInteractionService.hmdStatusChanged(active)

This signal is triggered when HMD (VR) display mode is switched on or off.

Parameters:active (bool) – True, if HMD mode has been switched on
vrImmersiveInteractionService.markersDetected(markers)

This signal is triggered when new markers are detected that have a confidence that is equal or higher than minimum marker confidence.

Parameters:markers (List[vrdMarker]) – The detected markers
vrImmersiveInteractionService.markersUpdated(markers)

This signal is triggered when new markers are detected that have a confidence that is equal or higher than minimum marker confidence.

Parameters:markers (List[vrdMarker]) – The detected markers
vrImmersiveInteractionService.showTooltipsOnStartChanged(show)

Notifies about changed show tooltips on start.

Parameters:show (bool) – Tooltips must show
vrImmersiveInteractionService.teleportGroundModeChanged(mode)

Notifies about changed teleport ground mode.

Parameters:mode (vrImmersiveInteractionTypes.TeleportGroundMode) – New ground mode