Class ULeapWidgetInteractionComponent

class ULeapWidgetInteractionComponent : public UWidgetInteractionComponent

This component will provide far field widgets with interactions Will need to add 2 components, one for the left hand and one for the right one For further information check our docs: https://docs.ultraleap.com/xr-and-tabletop/xr/unreal/plugin/features/UI-input-modules.html

Public Functions

void DrawLeapCursor(FLeapHandData &Hand)

Called every frame to draw the cursor

Parameters

Hand – - hand data from the api

UPROPERTY (BlueprintReadWrite, EditAnywhere, Category="UltraLeap UI", meta=(ClampMin="0.01", ClampMax="0.1", UIMin="0.01", UIMax="0.1")) float CursorSize

This can be used to change the cursor’s size

UPROPERTY (BlueprintReadWrite, EditAnywhere, Category="UltraLeap UI Far", meta=(ClampMin="0", ClampMax="5", UIMin="0", UIMax="5")) float WristRotationFactor

Controls how much rotation wrist movment adds to the ray

FVector GetHandRayDirection(FLeapHandData &TmpHand, FVector &Position)

Gets the rays direction

Parameters
  • TmpHand – - Hand data

  • Position – - will return the position updated with the relative neck offset

FVector GetNeckOffset()

Estimates the relative neck offset

Public Members

TEnumAsByte<EHandType> LeapHandType

Hand chirality, for left and right hands

TEnumAsByte<EUIInteractionType> WidgetInteraction

WidgetInteraction type, this requires the InteractionDistance to be <= 30 in order to change to NEAR interactions Changing this to NEAR will enable interactions with widgets by direct touch

UStaticMeshComponent *CursorStaticMesh

The default static mesh is a sphere, but can be changed to anything

UMaterial *MaterialBase

This can be used to change the cursor’s color

bool bAutoMode

This will automatically enable near distance interactions mode when the Distance between the hand and widget is less than 40 cm and far mode when the distance is more than 45 cm

float IndexDistanceFromUI

The distance in cm betweenn index and UI to trigger touch interaction

float InterpolationSpeed

Interpolation param, lower values will reduce jitter but add lag

float YAxisCalibOffset

For counter-acting the camera rotation to stabilize the rays

float ZAxisCalibOffset

For counter-acting the camera rotation to stabilize the rays

float ModeChangeThreshold

The threshold used to automatically switch between far/near interactions

FLeapRayComponentVisible OnRayComponentVisible

Event on rays visibility changed