Skip to content

Commit

Permalink
Rename methods for recomputing continuous surface & new button
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmed-shariff committed Jan 22, 2024
1 parent 6fe361a commit 08496fa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
11 changes: 9 additions & 2 deletions Editor/HPUIContinuousInteractableEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@ public override void OnInspectorGUI()
{
base.OnInspectorGUI();
GUI.enabled = EditorApplication.isPlaying;
if (GUILayout.Button("Run calibration"))
if (GUILayout.Button("Manual recompute"))
{
foreach (Object t in targets)
{
(t as HPUIContinuousInteractable)?.Configure();
(t as HPUIContinuousInteractable)?.ManualRecompute();
}
}
if (GUILayout.Button("Automated recompute"))
{
foreach (Object t in targets)
{
(t as HPUIContinuousInteractable)?.AutomatedRecompute();
}
}
GUI.enabled = true;
Expand Down
15 changes: 13 additions & 2 deletions Runtime/Interaction/HPUIContinuousInteractable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,27 @@ private void ClearKeypointsCache()
}

/// <summary>
/// Configure the continuous surface.
/// Manually compute the continuous surface. The hand posture
/// should be held such that all joints are flat when this is
/// being called.
/// </summary>
public void Configure()
public void ManualRecompute()
{
colliders.Clear();
ClearKeypointsCache();
keypointsCache = SetupKeypoints();
StartCoroutine(DelayedExecuteCalibration(x_size, y_size, keypointsCache));
}

/// <summary>
/// Restart the automated compuation procedure.
/// </summary>
public void AutomatedRecompute()
{
startedApproximatingJoints = false;
finishedApproximatingJoints = false;
}

/// <summary>
/// Generate the mesh after a short wait.
/// </summary>
Expand Down

0 comments on commit 08496fa

Please sign in to comment.