HoloToolkit.Unity.DirectionIndicator.GetDirectionIndicatorPositionAndRotation(UnityEngine.Vector3, UnityEngine.Transform, out UnityEngine.Vector3, out UnityEngine.Quaternion)

Here are the examples of the csharp api HoloToolkit.Unity.DirectionIndicator.GetDirectionIndicatorPositionAndRotation(UnityEngine.Vector3, UnityEngine.Transform, out UnityEngine.Vector3, out UnityEngine.Quaternion) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 View Source File : DirectionIndicator.cs
License : MIT License
Project Creator : microsoft

public void Update()
        {
            if (DirectionIndicatorObject == null)
            {
                return;
            }
            Camera mainCamera = CameraCache.Main;
            // Direction from the Main Camera to this script's parent gameObject.
            Vector3 camToObjectDirection = gameObject.transform.position - mainCamera.transform.position;
            camToObjectDirection.Normalize();

            // The cursor indicator should only be visible if the target is not visible.
            isDirectionIndicatorVisible = !IsTargetVisible(mainCamera);
            directionIndicatorRenderer.enabled = isDirectionIndicatorVisible;

            if (isDirectionIndicatorVisible)
            {
                Vector3 position;
                Quaternion rotation;
                GetDirectionIndicatorPositionAndRotation(
                    camToObjectDirection,
                    mainCamera.transform,
                    out position,
                    out rotation);

                DirectionIndicatorObject.transform.position = position;
                DirectionIndicatorObject.transform.rotation = rotation;
            }
        }