void AttachGazeController(GazeController newGaze) { if (newGaze == this) return; if (gazeController == null) gazeController = newGaze; }
public void AttachPlayer(GazeController newGaze) { if (player1 == null) player1 = newGaze; else player2 = newGaze; }
void Activate() { this.tag = "Untagged"; gazeController.GazeRelease (); gazeController = null; targeted = true; human.AddTarget(transform); }
static void Main(string[] args) { // Setup EyeTrackerCore gaze = new GazeController(1366, 768, 22); gaze.Start(); #region Setup regions // Set up "blue" region gaze.AddRegion("blue", -133, 768, 240, 240, 1.2); gaze.Regions["blue"].GazeEnterRegion += RegionEnter; gaze.Regions["blue"].GazeLeaveRegion += RegionLeave; gaze.Regions["blue"].GazeActivateRegion += RegionActivate; // Set up "green" region gaze.AddRegion("green", 155, 768, 240, 240, 0.5); gaze.Regions["green"].GazeEnterRegion += RegionEnter; gaze.Regions["green"].GazeLeaveRegion += RegionLeave; gaze.Regions["green"].GazeActivateRegion += RegionActivate; // Set up "center" region gaze.AddRegion("center", 433, 820, 500, 200, 2); gaze.Regions["center"].GazeEnterRegion += RegionEnter; gaze.Regions["center"].GazeLeaveRegion += RegionLeave; gaze.Regions["center"].GazeActivateRegion += RegionActivate; // Set up "down" region gaze.AddRegion("down", 433, 708, 500, 100, 0.7); gaze.Regions["down"].GazeEnterRegion += RegionEnter; gaze.Regions["down"].GazeLeaveRegion += RegionLeave; gaze.Regions["down"].GazeActivateRegion += RegionActivate; // Set up "red" region gaze.AddRegion("red", 971, 768, 240, 240, 0.5); gaze.Regions["red"].GazeEnterRegion += RegionEnter; gaze.Regions["red"].GazeLeaveRegion += RegionLeave; gaze.Regions["red"].GazeActivateRegion += RegionActivate; // Set up "yellow" region gaze.AddRegion("yellow", 1259, 768, 240, 240, 2); gaze.Regions["yellow"].GazeEnterRegion += RegionEnter; gaze.Regions["yellow"].GazeLeaveRegion += RegionLeave; gaze.Regions["yellow"].GazeActivateRegion += RegionActivate; #endregion // Loop Console.WriteLine("\n Eye Tracker is tracking ..."); Console.WriteLine(" Top-left: {0}\n Bottom-left: {1}\n Top-right: {2}", gaze.DisplayArea.TopLeft, gaze.DisplayArea.BottomLeft, gaze.DisplayArea.TopRight); Console.WriteLine(" -----------------------------------------------------"); while (Console.ReadKey().Key != ConsoleKey.Escape); // Loop until the esc-key has been pressed // EyeTrackerCore dispose gaze.Kill(); }
private void OnEnable() { myGazeController = GameObject.Find("GazeController").GetComponent <GazeController>(); myController = GetComponent <SteamVR_TrackedController>(); myController.TriggerClicked += HandleTriggerClicked; myController.PadClicked += HandlePadClicked; myController.MenuButtonClicked += HandleButtonClicked; // add menu button myController.Gripped += HandleGripped; }
public void Initialize() { poppedTime = 0; gazeController = null; lookedAtDuration = 0; startLookedAt = 0; prevLookTime = 0; lookedAt = false; targeted = false; fullyActive = false; teleported = false; transform.position = startPos; transform.rotation = startRot; teleportTime = 0; GetComponent<GazeController> ().ResetBalloon(); }
void ControlState() { if (!targeted) { // increment while being looked at if (lookedAt) { lookedAtDuration = Time.time - startLookedAt; } // stoppped being looked at if (Time.time - prevLookTime >= lookBuffer && lookedAt) { lookedAt = false; gazeController.GazeRelease (); gazeController = null; } // decrement while not looked at if (!lookedAt && lookedAtDuration > 0) { lookedAtDuration -= Time.deltaTime; } // Mathf.Clamp (lookedAtDuration, 0, activeBuffer); // reached maximum look duration if (lookedAtDuration >= activeBuffer) { Activate (); } float newR = origColor.r + (lookedAtDuration/activeBuffer) * (targetColor.r - origColor.r); float newG = origColor.g + (lookedAtDuration/activeBuffer) * (targetColor.g - origColor.g); float newB = origColor.b + (lookedAtDuration/activeBuffer) * (targetColor.b - origColor.b); if (kidMaterial != null) kidMaterial.material.color = new Color(newR,newG,newB); } }
void ControlState() { lookedAtDuration = Time.time - startLookedAt; // stoppped being looked at if (Time.time - prevLookTime >= lookBuffer && lookedAt) { lookedAt = false; gazeController.GazeRelease(); gazeController = null; } else if (lookedAt) { Activate (); } if (!lookedAt && music.volume > 0.1f) { music.volume -= Time.deltaTime / volumeAmpStep; } }
void AttachGazeController(GazeController newGaze) { if (gazeController = null) gazeController = newGaze; }
// Use this for initialization void Start() { gazeController = GameObject.FindGameObjectWithTag("Player").GetComponent<GazeController>(); anim = GetComponentInChildren<Animator> (); skinnedMeshRenderer = GetComponent<SkinnedMeshRenderer>(); }
// Use this for initialization void Start() { gazeController = GameObject.FindGameObjectWithTag("Player").GetComponent<GazeController>(); anim = GetComponentInChildren<Animator> (); rigidBodies = transform.GetComponentsInChildren<Rigidbody>(); }
// Use this for initialization void Start() { gazeController = GameObject.FindGameObjectWithTag("Player").GetComponent<GazeController>(); fullyInactive = true; }
// Use this for initialization void Start() { gazeController = GameObject.FindGameObjectWithTag("Player").GetComponent<GazeController>(); UpdateText (text); anim = GetComponentInChildren<Animator> (); fullyInactive = true; textTag = 11; }
// Start is called before the first frame update void Start() { m_isHovered = false; m_GazeController = GameObject.Find("GazeController").GetComponent <GazeController>(); // m_GazeController.hovered = IsHovered; }
// Use this for initialization void Start() { gazeController = GameObject.FindGameObjectWithTag("Player").GetComponent<GazeController>(); fullyInactive = true; fullTextLength = text.Length; curText = ""; }
// Start is called before the first frame update void Start() { gazeController = GameObject.FindObjectOfType <GazeController>(); }
// Use this for initialization void Start() { gazeController = GameObject.FindGameObjectWithTag("Player").GetComponent<GazeController>(); }
void Start() { gazeModel.isRunning = false; updateConnectionInformationInGazeModel(); gazeController = new GazeController(); initEyeThread(); startEyeThread(); InvokeRepeating("manageCoroutineUpdateTrackingScreen", 2f, 0.2f); InvokeRepeating("manageCoroutineUpdateEyeImage", 2f, 0.2f); }
// Use this for initialization void Start() { gazeController = GetComponent <GazeController>(); squareController = GetComponent <SquareController>(); squares = new List <GameObject>(); }