Created
February 8, 2017 14:20
-
-
Save kazukitanaka0611/464df34aba6ad2594b2c567471108ba2 to your computer and use it in GitHub Desktop.
HoloLens target ray roatate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void OnInputClicked(InputClickedEventData eventData) | |
{ | |
Vector3 headPosition = Camera.main.transform.position; | |
Vector3 gazeDirection = Camera.main.transform.forward; | |
RaycastHit hitInfo; | |
if (Physics.Raycast(headPosition, gazeDirection, out hitInfo, 30.0f, spatialMappingManager.LayerMask)) | |
{ | |
Instantiate(target, GazeManager.Instance.HitPosition, Quaternion.FromToRotation(Vector3.up, hitInfo.normal)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment