bool ULeapMotionFunctionLibrary::GetGrabStrength(int32 HandId, float& GrabStrength)
{
	FLeapMotionDevice* LeapDevice = FLeapMotionControllerPlugin::GetLeapDeviceSafe();
	if (LeapDevice)
	{
		LeapDevice->SetReferenceFrameOncePerTick();
		return LeapDevice->GetGrabStrength(HandId, GrabStrength);
	}
	return false;
}
Example #2
0
void ALeapMotionHandActor::Update(float DeltaSeconds)
{
	FLeapMotionDevice* Device = FLeapMotionControllerPlugin::GetLeapDeviceSafe();
	if (Device && Device->IsConnected())
	{
		Device->GetPinchStrength(HandId, PinchStrength);
		Device->GetGrabStrength(HandId, GrabStrength);
	}

	UpdateBones(DeltaSeconds);

	OnHandUpdated.Broadcast(HandId, DeltaSeconds);
}