Moved eye tracking over to the new demo format.
@@ -3,6 +3,11 @@ using System.Collections.Generic;
class DemoEyes : ITest
{
+ Matrix descPose = Matrix.TR (-0.5f, 0, -0.5f, Quat.LookDir(1,0,1));
+ string description = "If the hardware supports it, and permissions are granted, eye tracking is as simple as grabbing Input.Eyes!\n\nThis scene is raycasting your eye ray at the indicated plane, and the dot's red/green color indicates eye tracking availability! On flatscreen you can simulate eye tracking with Alt+Mouse.";
+ Matrix titlePose = Matrix.TRS(V.XYZ(-0.5f, 0.05f, -0.5f), Quat.LookDir(1, 0, 1), 2);
+ string title = "Eye Tracking";
+
List<LinePoint> points = new List<LinePoint>();
Vec3 previous;
@@ -11,7 +16,8 @@ class DemoEyes : ITest
public void Update()
{
- Plane plane = new Plane(new Vec3(0,0,-1.5f), -Vec3.Forward);
+ Plane plane = new Plane(new Vec3(0.5f,0,-0.5f), V.XYZ(-0.5f,0,0.5f));
+ Mesh.Quad.Draw(Material.Default, Matrix.TRS(new Vec3(0.54f, 0, -0.468f), Quat.LookDir(plane.normal), 0.5f));
if (Input.Eyes.Ray.Intersect(plane, out Vec3 at))
{
Color stateColor = Input.EyesTracked.IsActive()
@@ -37,5 +43,8 @@ class DemoEyes : ITest
}
Lines.Add(points.ToArray());
+
+ Text.Add(title, titlePose);
+ Text.Add(description, descPose, V.XY(0.4f, 0), TextFit.Wrap, TextAlign.TopCenter, TextAlign.TopLeft);
}
}
\ No newline at end of file
