-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vive Streaming fix / workaround (#30)
* Update DRES API to 2.0.0-RC2 * Implement default evaluation ID selection * Implement workaround for #28 * Fix quick submit (frame -> milliseconds)
- Loading branch information
Showing
4 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using UnityEngine; | ||
using UnityEngine.InputSystem.UI; | ||
using VitrivrVR.Config; | ||
|
||
namespace VitrivrVR.Util | ||
{ | ||
public class ViveStreamingFix : MonoBehaviour | ||
{ | ||
public InputSystemUIInputModule uiInputModule; | ||
private float _timer; | ||
|
||
private void Awake() | ||
{ | ||
if (ConfigManager.Config.viveStreamingFixEnabled) return; | ||
|
||
Destroy(this); | ||
} | ||
|
||
private void FixedUpdate() | ||
{ | ||
_timer += Time.fixedDeltaTime; | ||
if (!(_timer >= 1)) return; | ||
|
||
var res0 = uiInputModule.GetLastRaycastResult(0); | ||
var res1 = uiInputModule.GetLastRaycastResult(1); | ||
if (!res0.isValid && !res1.isValid) | ||
{ | ||
uiInputModule.enabled = false; | ||
uiInputModule.enabled = true; | ||
} | ||
|
||
_timer %= 1; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.