Leap Motion and SMI eye tracking on Objects
Hey guys, I need some help with Leap Motion and SMI eytracking in Unity. We are trying to combine Leap Motion and SMI Eye tracking, such that both work on one object. When gazing on the object and, e.g. changing color, one should be able to grasp the object. However If you call the InteractionBehavior Script as a function in the "Gazing" Script (change color if gaze is on object) it does not work, nor the color change. If the InteractionBehavior and Gaze Components are both applied as Behavior Components to an object, then only the grasping functions and the object does not change the color when gazing at it.
My problem is to identify what part is not working, two behavior components (SMI and Leap Motion) or just the color change part in the Gaze Script. It's quite difficult to explain but maybe someone have some experience with those two devices. Thanks in Advance!!
Just the important parts of the "Gaze" Script to change the color/ material.
namespace S$$anonymous$$I
{
[AddComponent$$anonymous$$enu("")]
[RequireComponent(typeof(InteractionBehaviour))]
public class GazeAction : Gaze$$anonymous$$onoBehaviour
{
public virtual void Start()
{
//Default material is stored to change the object material in OnGazeEnter.
meshrenderer = GetComponent<$$anonymous$$eshRenderer>();
if (meshrenderer != null)
{
default$$anonymous$$aterial = meshrenderer.material;
}
}
// Update is called once per frame
public virtual void Update()
{
}
private InteractionBehaviour _intObj;
public override void OnGazeEnter(RaycastHit hitInformation)
{
//If this game object has a parent GazeAction object, its OnGazeEnter must be called.
if (gazeParent != null)
{
gazeParent.OnGazeEnter(hitInformation);
}
// Script InteractionBehaviour soll als Feld _intObj aufgerufen werden
isGazed = true;
//////////////////////////////////////////////////////////////
//Change material while the player gazes at the object.
// Interact when gaze is on Object
if (gaze$$anonymous$$aterial != null && meshrenderer != null)
{
// InteractionBehaviour erlauben nur wenn EyeGaze auf Object ist
_intObj = GetComponent<InteractionBehaviour>();
//transform.Rotate(new Vector3(0, 30, 0));
meshrenderer.material = gaze$$anonymous$$aterial;
}
Your answer
