Leiting Posted October 12, 2022 Share Posted October 12, 2022 I want to konw the start point of SRanipal_Eye.Focus. I think it should be the Combined Gaze Origin. However, it seems to be defined as the System Origin. Link to comment Share on other sites More sharing options...
MasakiKitayama Posted February 3, 2023 Share Posted February 3, 2023 (edited) @Leiting 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; } Edited February 3, 2023 by MasakiKitayama Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now