Class ULeapComponent

class ULeapComponent : public UActorComponent, public ILeapConnectorCallbacks

Public Functions

void AreHandsVisible(bool &LeftIsVisible, bool &RightIsVisible)

Utility function to check if a hand is visible and tracked at this moment

void GetLatestFrameData(FLeapFrameData &OutData, const bool ApplyDeviceOrigin = false)

Polling function to get latest data

void GetHandSize(float &OutHandSize)

Get the hand size, by default it will get the left hand size In this method that we measure the middle finger length + palm position to start of finger as an indication of the hand size

Parameters

OutHandSize – - returns the hand size

void GetLRGrabStrength(TArray<float> &GrabStrength)

Get the grab strength for both hands

Parameters

GrabStrength – - returns the grab strength as an array Index 0 of the array is for the left hand Index 1 of the array is for the right hand

bool DoesCurrentGrabStrengthExceedTarget(const float GrabStrength, uint8 TargetHand)

Checks if the hand type can grab, but checking the pinch or grab strength

Parameters
  • GrabStrength – - the grab strength

  • Type – - the hand type

Returns

bool, if we can grab with this hand type (left or right)

UPROPERTY (BlueprintReadWrite, EditAnywhere, Category="Leap Devices", meta=(EditCondition="DisableEditMultiDeviceMode == false")) TEnumAsByte< ELeapMultiDeviceMode > MultiDeviceMode

Multidevice configuration, Singular subscribes to a single device. Combined subscribes to multiple devices combined into one device

Public Members

FLeapDeviceSignature OnLeapDeviceAttached

Called when a device connects to the leap service, this may happen before the game starts and you may not get the call

FLeapDeviceSignature OnLeapDeviceDetached

Called when a device disconnects from the leap service

FLeapFrameSignature OnLeapTrackingData

Event called when new tracking data is available, typically every game tick.

FLeapHandSignature OnHandGrabbed

Event called when a leap hand grab gesture is detected

FLeapHandSignature OnHandReleased

Event called when a leap hand release gesture is detected

FLeapHandSignature OnHandPinched

Event called when a leap hand pinch gesture is detected

FLeapHandSignature OnHandUnpinched

Event called when a leap hand unpinch gesture is detected

FLeapHandSignature OnHandBeginTracking

Event called when a leap hand enters the field of view and begins tracking

FLeapHandSignature OnHandEndTracking

Event called when a leap hand exits the field of view and stops tracking

FLeapVisibilityBoolSignature OnLeftHandVisibilityChanged

Event called when the left hand tracking changes

FLeapVisibilityBoolSignature OnRightHandVisibilityChanged

Event called when the right hand begins tracking

FLeapPolicySignature OnLeapPoliciesUpdated

Event called when leap policies have changed

FLeapImageEventSignature OnImageEvent

Event called when a device image is ready. Requires setting image policy first

FLeapEventSignature OnLeapServiceConnected

Event called when the leap service connects. Will likely be called before game begin play so some component won’t receive this call.

FLeapEventSignature OnLeapServiceDisconnected

Event called if leap service connection gets lost. Track won’t work if this event gets called.

TEnumAsByte<ELeapMode> TrackingMode

Tracking mode optimization

FLeapTrackingModeSignature OnLeapTrackingModeUpdated

Event called when leap policies have changed

TArray<FString> AvailableDeviceSerials

Available device list

FString ActiveDeviceSerial

Active Device (Singular mode only)

TArray<FString> CombinedDeviceSerials

Combined device list

bool DisableEditMultiDeviceMode

Disable/Grey out setting the multidevice mode.