public void FireHeadGesture(GazeInteractionEventArgs e) { if (HeadGesture != null) { HeadGesture(this, e); } }
public void FireRayExit(GazeInteractionEventArgs e) { if (RayExit != null) { RayExit(this, e); } }
public void FireRayIn(GazeInteractionEventArgs e) { if (RayIn != null) { RayIn(this, e); } }
void Handle_HeadGesture(object sender, GazeInteractionEventArgs e) { if (e.HeadGestureName == HeadGestureType.HeadDown) { confirmationStatus._HeadDown = e.HeadGestureStatus; } if (e.HeadGestureName == HeadGestureType.HeadUp) { confirmationStatus._HeadUp = e.HeadGestureStatus; } if (e.HeadGestureName == HeadGestureType.HeadRight) { confirmationStatus._HeadRight = e.HeadGestureStatus; } if (e.HeadGestureName == HeadGestureType.HeadLeft) { confirmationStatus._HeadLeft = e.HeadGestureStatus; } }
void FireGestureStatus(HeadGestureType gesture, bool status) { if (gesture == HeadGestureType.HeadDown) { if (status == HeadDown) { return; // Do not fire event again if the status has not changed } else { HeadDown = status; } } if (gesture == HeadGestureType.HeadUp) { if (status == HeadUp) { return; // Do not fire event again if the status has not changed } else { HeadUp = status; } } if (gesture == HeadGestureType.HeadRight) { if (status == HeadRight) { return; // Do not fire event again if the status has not changed } else { HeadRight = status; } } if (gesture == HeadGestureType.HeadLeft) { if (status == HeadLeft) { return; // Do not fire event again if the status has not changed } else { HeadLeft = status; } } // Fire GazeInteractionEventArgs e = new GazeInteractionEventArgs(); e.HeadGestureName = gesture; e.HeadGestureStatus = status; GazeInteractionEventManager.instance.FireHeadGesture(e); }
private void Update() { // RayCasting hits = Physics.RaycastAll(_ray_smooth_fixations, Mathf.Infinity); List <GameObject> temp = new List <GameObject>(); for (int i = 0; i < hits.Length; i++) { RaycastHit hit_i = hits[i]; temp.Add(hit_i.collider.gameObject); e = new GazeInteractionEventArgs(); e.Raycast_RaycastHit = hit_i; e.Raycast_GameObject = hit_i.collider.gameObject; e.Raycast_RayName = this.name; GazeInteractionEventManager.instance.FireRayIn(e); } hit_objects_list = temp; // trigger RayEnter for objects that are inside hit_objects_list but not in pre_hit_objects_list foreach (GameObject obj in hit_objects_list) { if (pre_hit_objects_list.Contains(obj) != true) { e = new GazeInteractionEventArgs(); e.Raycast_GameObject = obj.gameObject; e.Raycast_RayName = this.name; GazeInteractionEventManager.instance.FireRayEnter(e); } } // trigger RayExit for objects that are inside pre_hit_objects_list but not in hit_objects_list foreach (GameObject obj in pre_hit_objects_list) { if (hit_objects_list.Contains(obj) != true) { e = new GazeInteractionEventArgs(); e.Raycast_GameObject = obj.gameObject; e.Raycast_RayName = this.name; GazeInteractionEventManager.instance.FireRayExit(e); } } pre_hit_objects_list = hit_objects_list; }
void Handle_RayIn(object sender, GazeInteractionEventArgs e) { if (e.Raycast_GameObject.gameObject == this.gameObject) { if (e.Raycast_RayName == "GazeRayForInteraction") { pointingStatus._GazeIn = true; } else if (e.Raycast_RayName == "LaserRayForInteraction") { pointingStatus._LaserIn = true; } else if (e.Raycast_RayName == "ReticleRayForInteraction") { pointingStatus._ReticleIn = true; } } }