bool ULeapMotionFunctionLibrary::SetImagePolicy(bool UseImagePolicy) { FLeapMotionDevice* LeapDevice = FLeapMotionControllerPlugin::GetLeapDeviceSafe(); if (LeapDevice) { return LeapDevice->SetImagePolicy(UseImagePolicy); } return false; }
// Called when the game starts void ULeapMotionImageComponent::InitializeComponent() { Super::InitializeComponent(); // ... DynamicPassthroughMaterial = UKismetMaterialLibrary::CreateDynamicMaterialInstance(this, PassthroughMaterial); DisplaySurfaceComponent->SetMaterial(0, DynamicPassthroughMaterial); FLeapMotionDevice* Device = FLeapMotionControllerPlugin::GetLeapDeviceSafe(); if (Device && Device->IsConnected()) { Device->SetImagePolicy(true); } }