replace all bitfield uproperties with booleans
This commit is contained in:
@@ -148,7 +148,7 @@ struct USGVirtualHandComponent::FImpl
|
||||
FORCEINLINE bool ShouldDrawDebugVirtualHand() const
|
||||
{
|
||||
const FSGVirtualHandDebuggingSettings& Settings{Owner->GetVirtualHandSettings().DebuggingSettings};
|
||||
const bool bDraw = !!Settings.bDrawDebugVirtualHand
|
||||
const bool bDraw = Settings.bDrawDebugVirtualHand
|
||||
&& Settings.DrawingMode != ESGDebugVirtualHandDrawingMode::None;
|
||||
return bDraw;
|
||||
}
|
||||
@@ -280,7 +280,7 @@ FSGVirtualHandSettings USGVirtualHandComponent::GetVirtualHandSettings() const
|
||||
}
|
||||
|
||||
const FSGVirtualHandSettings VirtualHandSettings{
|
||||
!!VirtualHandSettingsOverrides.bVisibleWhenHandDataUnavailable,
|
||||
VirtualHandSettingsOverrides.bVisibleWhenHandDataUnavailable,
|
||||
VirtualHandSettingsOverrides.AnimationSettings,
|
||||
VirtualHandSettingsOverrides.DebuggingSettings,
|
||||
VirtualHandSettingsOverrides.GrabSettings,
|
||||
@@ -362,7 +362,7 @@ void USGVirtualHandComponent::UninitializeComponent()
|
||||
|
||||
const USGGloveTracker* GloveTracker{USGGloveTracker::GetInstance(GetOuter())};
|
||||
USGHapticGlove* Glove{IsValid(GloveTracker) ? GloveTracker->GetGlove(IsRight()) : nullptr};
|
||||
const bool bAutoStopHaptics = !!GetVirtualHandSettings().HapticsSettings.bAutoStopAllHapticsOnEndPlay;
|
||||
const bool bAutoStopHaptics = GetVirtualHandSettings().HapticsSettings.bAutoStopAllHapticsOnEndPlay;
|
||||
if (IsValid(Glove) && Glove->IsConnected() && bAutoStopHaptics)
|
||||
{
|
||||
Glove->StopHaptics();
|
||||
@@ -382,7 +382,7 @@ void USGVirtualHandComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||
|
||||
const USGGloveTracker* GloveTracker{USGGloveTracker::GetInstance(GetOuter())};
|
||||
USGHapticGlove* Glove{IsValid(GloveTracker) ? GloveTracker->GetGlove(IsRight()) : nullptr};
|
||||
const bool bAutoStopHaptics = !!GetVirtualHandSettings().HapticsSettings.bAutoStopAllHapticsOnEndPlay;
|
||||
const bool bAutoStopHaptics = GetVirtualHandSettings().HapticsSettings.bAutoStopAllHapticsOnEndPlay;
|
||||
if (IsValid(Glove) && Glove->IsConnected() && bAutoStopHaptics)
|
||||
{
|
||||
Glove->StopHaptics();
|
||||
@@ -577,7 +577,7 @@ void USGVirtualHandComponent::FImpl::OverridePluginSettingsPropertyChanged()
|
||||
|
||||
const FSGVirtualHandSettings& PluginVirtualHandSettings{Settings->GetVirtualHandSettings()};
|
||||
Owner->VirtualHandSettingsOverrides.bVisibleWhenHandDataUnavailable =
|
||||
!!PluginVirtualHandSettings.bVisibleWhenHandDataUnavailable;
|
||||
PluginVirtualHandSettings.bVisibleWhenHandDataUnavailable;
|
||||
Owner->VirtualHandSettingsOverrides.AnimationSettings = PluginVirtualHandSettings.AnimationSettings;
|
||||
Owner->VirtualHandSettingsOverrides.DebuggingSettings = PluginVirtualHandSettings.DebuggingSettings;
|
||||
Owner->VirtualHandSettingsOverrides.GrabSettings = PluginVirtualHandSettings.GrabSettings;
|
||||
@@ -743,7 +743,7 @@ void USGVirtualHandComponent::FImpl::UpdateVisibility()
|
||||
&& MotionControllerData.DeviceVisualType == EXRVisualType::Hand;
|
||||
const bool bHandVisible = Owner->IsVisible();
|
||||
const bool bShouldBeVisibleWhenHandDataUnavailable =
|
||||
!!Owner->GetVirtualHandSettings().bVisibleWhenHandDataUnavailable;
|
||||
Owner->GetVirtualHandSettings().bVisibleWhenHandDataUnavailable;
|
||||
|
||||
bool bSetNewVisibility = false;
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ void USGWristTrackerComponent::TickComponent(
|
||||
|
||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
||||
|
||||
if (!!GetWristTrackingSettings().DebuggingSettings.bDrawDebugWristTracker)
|
||||
if (GetWristTrackingSettings().DebuggingSettings.bDrawDebugWristTracker)
|
||||
{
|
||||
Pimpl->DrawDebugWristTracker();
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ private:
|
||||
EAttachmentRule AttachmentScaleRule;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
uint8 bAttachmentWeldSimulatedBodies : 1;
|
||||
bool bAttachmentWeldSimulatedBodies;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
FName AttachmentSocketName;
|
||||
@@ -80,10 +80,10 @@ private:
|
||||
EDetachmentRule DetachmentScaleRule;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
uint8 bDetachmentCallModify : 1;
|
||||
bool bDetachmentCallModify;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
uint8 bAffectPhysicsState : 1;
|
||||
bool bAffectPhysicsState;
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
|
||||
FORCEINLINE bool GetAttachmentWeldSimulatedBodies() const
|
||||
{
|
||||
return !!bAttachmentWeldSimulatedBodies;
|
||||
return bAttachmentWeldSimulatedBodies;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetAttachmentWeldSimulatedBodies(const bool bInAttachmentWeldSimulatedBodies)
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
|
||||
FORCEINLINE bool GetDetachmentInCallModify() const
|
||||
{
|
||||
return !!bDetachmentCallModify;
|
||||
return bDetachmentCallModify;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetDetachmentInCallModify(const bool bInDetachmentCallModify)
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
|
||||
FORCEINLINE bool GetAffectPhysicsState() const
|
||||
{
|
||||
return !!bAffectPhysicsState;
|
||||
return bAffectPhysicsState;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetAffectPhysicsState(const bool bInAffectPhysicsState)
|
||||
|
||||
@@ -95,7 +95,7 @@ private:
|
||||
|
||||
private:
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
uint8 bRight : 1;
|
||||
bool bRight;
|
||||
|
||||
/**
|
||||
* Overrides the plugin's virtual hand settings.
|
||||
@@ -119,14 +119,14 @@ public:
|
||||
|
||||
FORCEINLINE bool IsRight() const
|
||||
{
|
||||
return !!bRight;
|
||||
return bRight;
|
||||
}
|
||||
|
||||
void SetRight(const bool bInRight);
|
||||
|
||||
FORCEINLINE bool OverridesPluginVirtualHandSettings() const
|
||||
{
|
||||
return !!VirtualHandSettingsOverrides.bOverridePluginSettings;
|
||||
return VirtualHandSettingsOverrides.bOverridePluginSettings;
|
||||
}
|
||||
|
||||
FORCEINLINE const FSGVirtualHandSettingsOverrides& GetVirtualHandSettingsOverrides() const
|
||||
|
||||
@@ -93,7 +93,7 @@ private:
|
||||
|
||||
private:
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
uint8 bRight : 1;
|
||||
bool bRight;
|
||||
|
||||
/**
|
||||
* Overrides the plugin's wrist tracking settings.
|
||||
@@ -116,14 +116,14 @@ public:
|
||||
|
||||
FORCEINLINE bool IsRight() const
|
||||
{
|
||||
return !!bRight;
|
||||
return bRight;
|
||||
}
|
||||
|
||||
void SetRight(const bool bInRight);
|
||||
|
||||
FORCEINLINE bool OverridesPluginWristTrackingSettings() const
|
||||
{
|
||||
return !!WristTrackingSettingsOverrides.bOverridePluginSettings;
|
||||
return WristTrackingSettingsOverrides.bOverridePluginSettings;
|
||||
}
|
||||
|
||||
FORCEINLINE const FSGWristTrackingSettingsOverrides& GetWristTrackingSettingsOverrides() const
|
||||
|
||||
@@ -51,7 +51,7 @@ class SENSEGLOVEBACKEND_API USGBackend : public UEngineSubsystem
|
||||
|
||||
private:
|
||||
UPROPERTY(Transient)
|
||||
uint8 bBackendInitialized : 1;
|
||||
bool bBackendInitialized;
|
||||
|
||||
public:
|
||||
static USGBackend* GetInstance();
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
public:
|
||||
FORCEINLINE bool IsBackendInitialized() const
|
||||
{
|
||||
return !!bBackendInitialized;
|
||||
return bBackendInitialized;
|
||||
}
|
||||
|
||||
bool InitializeBackend();
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
FColor Color;
|
||||
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Cube")
|
||||
uint8 bPersistentLines : 1;
|
||||
bool bPersistentLines;
|
||||
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Cube")
|
||||
float LifeTimeModifier;
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
FColor ZAxisColor;
|
||||
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Gizmo")
|
||||
uint8 bPersistentLines : 1;
|
||||
bool bPersistentLines;
|
||||
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Gizmo")
|
||||
float LifeTimeModifier;
|
||||
|
||||
@@ -55,14 +55,14 @@ public:
|
||||
* between motion sources from different device types.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category="Hand Tracking")
|
||||
uint8 bUseMoreSpecificMotionSourceNames : 1;
|
||||
bool bUseMoreSpecificMotionSourceNames;
|
||||
|
||||
/**
|
||||
* If true hand tracking supports the 'Left' and 'Right' legacy motion sources. If false it does not. False is
|
||||
* recommended unless you need legacy compatibility in an older unreal projects.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category="Hand Tracking")
|
||||
uint8 bSupportLegacyControllerMotionSources : 1;
|
||||
bool bSupportLegacyControllerMotionSources;
|
||||
|
||||
public:
|
||||
FSGHandTrackingSettings();
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
* like this behavior for whatever reason, consider disabling this option.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category="Initialization")
|
||||
uint8 bValidateIfDefaultClassesAreSGCompliant : 1;
|
||||
bool bValidateIfDefaultClassesAreSGCompliant;
|
||||
|
||||
public:
|
||||
FSGInitializationSettings();
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
* supported by the HMD device.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category="Tracking")
|
||||
uint8 bFallbackToHandTrackingIfNoGloveDetected : 1;
|
||||
bool bFallbackToHandTrackingIfNoGloveDetected;
|
||||
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category="Tracking")
|
||||
FSGGloveTrackingSettings GloveTrackingSettings;
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
FRotator AnimationBoneRotationCorrectionOffset;
|
||||
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category="Animation")
|
||||
uint8 bShouldAnimationApplyBoneLocation : 1;
|
||||
bool bShouldAnimationApplyBoneLocation;
|
||||
|
||||
public:
|
||||
FSGVirtualHandAnimationSettings();
|
||||
|
||||
@@ -54,7 +54,7 @@ struct SENSEGLOVESETTINGS_API FSGVirtualHandDebuggingSettings
|
||||
|
||||
public:
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging")
|
||||
uint8 bDrawDebugVirtualHand : 1;
|
||||
bool bDrawDebugVirtualHand;
|
||||
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging",
|
||||
meta=(EditCondition="bDrawDebugVirtualHand", EditConditionHides))
|
||||
|
||||
@@ -52,7 +52,7 @@ struct SENSEGLOVESETTINGS_API FSGVirtualHandHapticsSettings
|
||||
|
||||
public:
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category="Haptics")
|
||||
uint8 bAutoStopAllHapticsOnEndPlay : 1;
|
||||
bool bAutoStopAllHapticsOnEndPlay;
|
||||
|
||||
public:
|
||||
FSGVirtualHandHapticsSettings();
|
||||
|
||||
@@ -57,7 +57,7 @@ struct SENSEGLOVESETTINGS_API FSGVirtualHandSettings
|
||||
|
||||
public:
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category="Virtual Hand")
|
||||
uint8 bVisibleWhenHandDataUnavailable : 1;
|
||||
bool bVisibleWhenHandDataUnavailable;
|
||||
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category="Virtual Hand")
|
||||
FSGVirtualHandAnimationSettings AnimationSettings;
|
||||
|
||||
@@ -59,11 +59,11 @@ public:
|
||||
* Determines whether to override the plugin's virtual hand settings or not.
|
||||
*/
|
||||
UPROPERTY(EditAnywhere, Category = "SenseGlove")
|
||||
uint8 bOverridePluginSettings : 1;
|
||||
bool bOverridePluginSettings;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "SenseGlove",
|
||||
meta=(EditCondition="bOverridePluginSettings", EditConditionHides))
|
||||
uint8 bVisibleWhenHandDataUnavailable : 1;
|
||||
bool bVisibleWhenHandDataUnavailable;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "SenseGlove",
|
||||
meta=(EditCondition="bOverridePluginSettings", EditConditionHides))
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
* If enabled, draws debug Wrist trackers where possible.
|
||||
*/
|
||||
UPROPERTY(EditAnywhere, Category = "Debugging")
|
||||
uint8 bDrawDebugWristTracker : 1;
|
||||
bool bDrawDebugWristTracker;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugGizmo is enabled.
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
* Determines whether to override the plugin's wrist tracking settings or not.
|
||||
*/
|
||||
UPROPERTY(EditAnywhere, Category = "SenseGlove")
|
||||
uint8 bOverridePluginSettings : 1;
|
||||
bool bOverridePluginSettings;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "SenseGlove",
|
||||
meta=(EditCondition="bOverridePluginSettings", EditConditionHides))
|
||||
|
||||
@@ -60,7 +60,7 @@ bool FSGXRHandState::GetTransform(const EHandKeypoint Keypoint, FTransform& OutT
|
||||
check(static_cast<int32>(Keypoint) < EHandKeypointCount);
|
||||
OutTransform = KeypointTransforms[static_cast<uint32>(Keypoint)];
|
||||
|
||||
return !!bReceivedJointPoses;
|
||||
return bReceivedJointPoses;
|
||||
}
|
||||
|
||||
const FTransform& FSGXRHandState::GetTransform(const EHandKeypoint Keypoint) const
|
||||
|
||||
@@ -106,7 +106,7 @@ struct FSGXRTracker::FImpl
|
||||
const USGSettings* Settings{USGSettings::GetInstance()};
|
||||
ensureAlwaysMsgf(Settings, TEXT("The settings subsystem has not been initialized!"));
|
||||
const bool bFallbackToHandTrackingIfNoGloveDetected =
|
||||
!!Settings->GetTrackingSettings().bFallbackToHandTrackingIfNoGloveDetected;
|
||||
Settings->GetTrackingSettings().bFallbackToHandTrackingIfNoGloveDetected;
|
||||
return bFallbackToHandTrackingIfNoGloveDetected;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ struct FSGXRTracker::FImpl
|
||||
const bool bFallbackToHandTrackingIfNoGloveDetected = ShouldFallbackToHandTrackingIfNoGloveDetected();
|
||||
const bool bUseMoreSpecificMotionSourceNames =
|
||||
bFallbackToHandTrackingIfNoGloveDetected
|
||||
? !!Settings->GetTrackingSettings().HandTrackingSettings.bUseMoreSpecificMotionSourceNames
|
||||
? Settings->GetTrackingSettings().HandTrackingSettings.bUseMoreSpecificMotionSourceNames
|
||||
: false;
|
||||
return bUseMoreSpecificMotionSourceNames;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ struct FSGXRTracker::FImpl
|
||||
const bool bFallbackToHandTrackingIfNoGloveDetected = ShouldFallbackToHandTrackingIfNoGloveDetected();
|
||||
const bool bSupportLegacyControllerMotionSources =
|
||||
bFallbackToHandTrackingIfNoGloveDetected
|
||||
? !!Settings->GetTrackingSettings().HandTrackingSettings.bSupportLegacyControllerMotionSources
|
||||
? Settings->GetTrackingSettings().HandTrackingSettings.bSupportLegacyControllerMotionSources
|
||||
: false;
|
||||
return bSupportLegacyControllerMotionSources;
|
||||
}
|
||||
@@ -591,7 +591,7 @@ struct FSGXRTracker::FImpl
|
||||
* Member variables
|
||||
************************/
|
||||
|
||||
uint8 bHandTrackingAvailable : 1;
|
||||
bool bHandTrackingAvailable;
|
||||
|
||||
PFN_xrCreateHandTrackerEXT XRCreateHandTrackerEXT;
|
||||
PFN_xrDestroyHandTrackerEXT XRDestroyHandTrackerEXT;
|
||||
@@ -1225,7 +1225,7 @@ bool FSGXRTracker::IsHandTrackingSupportedByDevice() const
|
||||
const bool bFallbackToHandTrackingIfNoGloveDetected = FImpl::ShouldFallbackToHandTrackingIfNoGloveDetected();
|
||||
|
||||
const bool bAnyGloveConnected = FImpl::IsAnyGloveConnected();
|
||||
const bool bHandTrackingAvailable = !!Pimpl->bHandTrackingAvailable;
|
||||
const bool bHandTrackingAvailable = Pimpl->bHandTrackingAvailable;
|
||||
|
||||
const bool bHandTrackingSupportedByDevice =
|
||||
bAnyGloveConnected || (bFallbackToHandTrackingIfNoGloveDetected && bHandTrackingAvailable);
|
||||
@@ -1301,7 +1301,7 @@ const void* FSGXRTracker::OnCreateSession(const XrInstance InInstance, const XrS
|
||||
|
||||
const void* FSGXRTracker::OnBeginSession(const XrSession InSession, const void* InNext)
|
||||
{
|
||||
const bool bHandTrackingAvailable = !!Pimpl->bHandTrackingAvailable;
|
||||
const bool bHandTrackingAvailable = Pimpl->bHandTrackingAvailable;
|
||||
|
||||
if (bHandTrackingAvailable)
|
||||
{
|
||||
@@ -1462,7 +1462,7 @@ ETrackingStatus FSGXRTracker::GetControllerTrackingStatus(const int32 Controller
|
||||
if (bFallbackToHandTrackingIfNoGloveDetected)
|
||||
{
|
||||
const FSGXRHandState& HandState{bRight ? GetRightHandState() : GetLeftHandState()};
|
||||
return !!HandState.bReceivedJointPoses ? ETrackingStatus::Tracked : ETrackingStatus::NotTracked;
|
||||
return HandState.bReceivedJointPoses ? ETrackingStatus::Tracked : ETrackingStatus::NotTracked;
|
||||
}
|
||||
|
||||
return ETrackingStatus::NotTracked;
|
||||
@@ -1545,7 +1545,7 @@ bool FSGXRTracker::IsHandTrackingStateValid() const
|
||||
{
|
||||
const bool bFallbackToHandTrackingIfNoGloveDetected = FImpl::ShouldFallbackToHandTrackingIfNoGloveDetected();
|
||||
|
||||
const bool bHandTrackingAvailable = !!Pimpl->bHandTrackingAvailable;
|
||||
const bool bHandTrackingAvailable = Pimpl->bHandTrackingAvailable;
|
||||
const bool bAnyGloveConnected = FImpl::IsAnyGloveConnected();
|
||||
|
||||
const bool bHandTrackingStateValid =
|
||||
@@ -1717,7 +1717,7 @@ bool FSGXRTracker::FImpl::CanOutputTrackingData(const EControllerHand Hand) cons
|
||||
{
|
||||
const bool bFallbackToHandTrackingIfNoGloveDetected = ShouldFallbackToHandTrackingIfNoGloveDetected();
|
||||
|
||||
const bool bIsHandTrackingAvailable = !!bHandTrackingAvailable;
|
||||
const bool bIsHandTrackingAvailable = bHandTrackingAvailable;
|
||||
|
||||
bool bGloveConnected = false;
|
||||
if (Hand == EControllerHand::Left)
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
float Radii[EHandKeypointCount];
|
||||
|
||||
uint8 bReceivedJointPoses : 1;
|
||||
bool bReceivedJointPoses;
|
||||
|
||||
public:
|
||||
FSGXRHandState();
|
||||
|
||||
Reference in New Issue
Block a user