Skip to content

Commit

Permalink
feat(client): added platform adaptive depth dtype selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
YiqinZhao committed Sep 18, 2024
1 parent ab62c2f commit d127015
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion unity/Assets/Scripts/ARFlowDeviceSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void Start()
// Application.targetFrameRate = 30;
}

bool validIP (string ipField)
bool validIP(string ipField)
{
return Regex.IsMatch(ipField, @"(\d){1,3}\.(\d){1,3}\.(\d){1,3}\.(\d){1,3}");
}
Expand Down Expand Up @@ -99,7 +99,12 @@ private void OnConnectButtonClick()
CameraDepth = new RegisterRequest.Types.CameraDepth()
{
Enabled = true,
#if UNITY_ANDROID
DataType = "u16", // f32 for iOS, u16 for Android
#endif
#if (UNITY_IOS || UNITY_VISIONOS)
DataType = "f32",
#endif
ConfidenceFilteringLevel = 0,
ResolutionX = depthImage.dimensions.x,
ResolutionY = depthImage.dimensions.y
Expand Down
2 changes: 1 addition & 1 deletion unity/Assets/Scripts/ARFlowXiheDemo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private void OnConnectButtonClick()
#if UNITY_ANDROID
DataType = "u16", // f32 for iOS, u16 for Android
#endif
#if UNITY_IPHONE
#if (UNITY_IOS || UNITY_VISIONOS)
DataType = "f32",
#endif
ConfidenceFilteringLevel = 0,
Expand Down

0 comments on commit d127015

Please sign in to comment.