Skip to content

Commit 737381d

Browse files
authored
Merge pull request #3761 from thalbern/feature/fix_hand_mesh
fixed hand mesh loading on hl2
2 parents b39dcac + 39cef1f commit 737381d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Assets/MixedRealityToolkit.Providers/WindowsMixedReality/WindowsMixedRealityController.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public override void SetupDefaultInteractions(Handedness controllerHandedness)
9494
private MixedRealityPose currentGripPose = MixedRealityPose.ZeroIdentity;
9595

9696
private bool controllerModelInitialized = false;
97-
private bool failedToObtainControllerModel = false;
97+
private bool isControllerModelLoaded = false;
9898

9999
#region Update data functions
100100

@@ -543,7 +543,7 @@ protected override bool TryRenderControllerModel(Type controllerType, InputSourc
543543
// Note: Obtaining models from the driver will require access to the InteractionSource.
544544
// It's unclear whether the interaction source will be available during setup, so we attempt to create
545545
// the controller model on an input update
546-
if (failedToObtainControllerModel ||
546+
if (!isControllerModelLoaded ||
547547
GetControllerVisualizationProfile() == null ||
548548
!GetControllerVisualizationProfile().GetUseDefaultModelsOverride(GetType(), ControllerHandedness))
549549
{
@@ -607,10 +607,11 @@ private async void CreateControllerModelFromPlatformSDK(uint interactionSourceId
607607
}
608608
}
609609

610-
if (gltfGameObject == null)
610+
611+
isControllerModelLoaded = (gltfGameObject != null);
612+
if (!isControllerModelLoaded)
611613
{
612614
Debug.LogWarning("Failed to create controller model from driver, defaulting to BaseController behavior");
613-
failedToObtainControllerModel = true;
614615
TryRenderControllerModel(GetType(), InputSourceType.Controller);
615616
}
616617
}

0 commit comments

Comments
 (0)