Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eye tracking node fix #59

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions ProjectObsidian/ProtoFlux/Users/Status/IsUserEyeTracking.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using FrooxEngine;
using FrooxEngine.ProtoFlux;
using FrooxEngine.ProtoFlux.Runtimes.Execution.Nodes;
using ProtoFlux.Core;
using ProtoFlux.Runtimes.Execution;

Expand All @@ -11,7 +10,7 @@ namespace ProtoFlux.Runtimes.Execution.Nodes.Obsidian.Users.Status
public class IsUserEyeTracking : ValueFunctionNode<FrooxEngineContext, bool>
{
public readonly ObjectInput<User> User;
public readonly ObjectInput<EyeSide> Side;
public readonly ValueInput<EyeSide> Side;

protected override bool Compute(FrooxEngineContext context)
{
Expand All @@ -22,7 +21,14 @@ protected override bool Compute(FrooxEngineContext context)
if (eyeTrackingStreamManager != null)
{
EyeSide side = Side.Evaluate(context);
return eyeTrackingStreamManager.GetIsTracking(side);
if (side != EyeSide.Combined)
{
return eyeTrackingStreamManager.GetIsTracking(side);
}
else
{
return eyeTrackingStreamManager.GetIsTracking(EyeSide.Left) && eyeTrackingStreamManager.GetIsTracking(EyeSide.Right);
}
}
}
return false;
Expand Down