MasakiKitayama
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Gallery
Blogs
Events
Store
Downloads
Posts posted by MasakiKitayama
-
-
I think it is a bug.
The origin of the local variable "rayGlobal" should be the origin of the gaze rays (Left, Right, or Combined).
Manual fix of the Focus method:
public static bool Focus(GazeIndex index, out Ray ray, out FocusInfo focusInfo, float radius, float maxDistance, int focusableLayer, EyeData_v2 eye_data) { bool valid = GetGazeRay(index, out ray, eye_data); if (valid) { Ray rayGlobal = new Ray( Camera.main.transform.position + Camera.main.transform.rotation * ray.origin, Camera.main.transform.TransformDirection(ray.direction)); RaycastHit hit; if (radius == 0) valid = Physics.Raycast(rayGlobal, out hit, maxDistance, focusableLayer); else valid = Physics.SphereCast(rayGlobal, radius, out hit, maxDistance, focusableLayer); focusInfo = new FocusInfo { point = hit.point, normal = hit.normal, distance = hit.distance, collider = hit.collider, rigidbody = hit.rigidbody, transform = hit.transform }; } else { focusInfo = new FocusInfo(); } return valid; }
Gaze ray origin
in VIVE Eye and Facial Tracking SDK
Posted
In my opinion, using the System Origin (Camera.main.transform.position) as the gaze origin in the World coordinate system is not a very good implementation.
I propose to use the corrected System Origin with the (local) gaze origin obtained by SRanipal_Eye_v2.GetGazeRay method as below, instead.
Using above implementation, for example, the SRanipal_Eye_v2.Focus method can be modified as follows (the code before modification is commented out).
I can't vouch for the validity of the above implementation, but it seems to work better than the original implementation, at least for my project.