Skip to content
Snippets Groups Projects
Commit fd9e93ba authored by Daniel Sous's avatar Daniel Sous
Browse files

Make gaze visible and deactive sphere colliders

parent baed4e12
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is stored in LFS. Options to address this: view the blob.
fileFormatVersion: 2
guid: e8a9305fb6398d54ab494fc70176acf3
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Tobii;
using Tobii.G2OM;
using Tobii.XR;
public class ShowGaze : MonoBehaviour
{
public Shader lineShader;
public bool drawnGazeLine;
// Update is called once per frame
void Update()
{
if (drawnGazeLine)
{
// Get eye tracking data in world space
var eyeTrackingData = TobiiXR.GetEyeTrackingData(TobiiXR_TrackingSpace.World);
// Check if gaze ray is valid
if (eyeTrackingData.GazeRay.IsValid)
{
// The origin of the gaze ray is a 3D point
var rayOrigin = eyeTrackingData.GazeRay.Origin;
// The direction of the gaze ray is a normalized direction vector
var rayDirection = eyeTrackingData.GazeRay.Direction;
var end = rayOrigin + 10 * rayDirection;
DrawLine(rayOrigin, end, Color.red);
}
}
}
void DrawLine(Vector3 start, Vector3 end, Color color, float duration = 0.01f)
{
start.y = start.y - 0.3f;
GameObject myLine = new GameObject();
myLine.transform.position = start;
myLine.AddComponent<LineRenderer>();
LineRenderer lr = myLine.GetComponent<LineRenderer>();
lr.material = new Material(lineShader);
lr.SetColors(color, color);
lr.SetWidth(0.01f, 0.01f);
lr.SetPosition(0, start);
lr.SetPosition(1, end);
GameObject.Destroy(myLine, duration);
}
}
fileFormatVersion: 2
guid: bc45e69801e1e8f45a299401a6d8b58b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -15,7 +15,7 @@ public static class MenuDataHolder
public static bool isNonScripted { get; set; } = false; //random behaviour of class starts with "true"
public static bool isPresentation { get; set; } = true;//if true students will look at teacher. if false students will write
public static bool isAutomaticIntervention { get; set; } = true;//if true misbehaviour is interrupted automatically by a close teacher for example
public static bool isAutomaticIntervention { get; set; } = false;//if true misbehaviour is interrupted automatically by a close teacher for example
//if false missbehaviour is interupted by the Teacher by clicking on the Student
public static bool isExperiment { get; set; } = false;//if true scripts from erzwis are used. if false other options determine behaviour of class
......
......@@ -93,7 +93,7 @@ QualitySettings:
skinWeights: 2
textureQuality: 0
anisotropicTextures: 1
antiAliasing: 0
antiAliasing: 2
softParticles: 0
softVegetation: 0
realtimeReflectionProbes: 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment