minor fixes

This commit is contained in:
Mamadou Babaei
2024-08-16 18:00:56 +02:00
parent 60cbdfd4c6
commit 54481effbd
2 changed files with 12 additions and 14 deletions
@@ -368,16 +368,15 @@ bool USGVirtualHandComponent::GetMotionControllerData(FXRMotionControllerData& O
{
OutMotionControllerData.bValid = false;
if (GEngine)
IXRTrackingSystem* XRTrackingSystem{GEngine ? GEngine->XRSystem.Get() : nullptr};
if (!XRTrackingSystem)
{
IXRTrackingSystem* XrtTrackingSystem{GEngine->XRSystem.Get()};
if (XrtTrackingSystem)
{
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
XrtTrackingSystem->GetMotionControllerData(this, Hand, OutMotionControllerData);
}
return false;
}
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
XRTrackingSystem->GetMotionControllerData(this, Hand, OutMotionControllerData);
return OutMotionControllerData.bValid;
}
@@ -184,16 +184,15 @@ bool USGWristTrackerComponent::GetMotionControllerData(FXRMotionControllerData&
{
OutMotionControllerData.bValid = false;
if (GEngine)
IXRTrackingSystem* XRTrackingSystem{GEngine ? GEngine->XRSystem.Get() : nullptr};
if (!XRTrackingSystem)
{
IXRTrackingSystem* XrtTrackingSystem{GEngine->XRSystem.Get()};
if (XrtTrackingSystem)
{
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
XrtTrackingSystem->GetMotionControllerData(this, Hand, OutMotionControllerData);
}
return false;
}
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
XRTrackingSystem->GetMotionControllerData(this, Hand, OutMotionControllerData);
return OutMotionControllerData.bValid;
}