AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
BaseControllerPointer.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
5 using UnityEngine;
6 
8 {
9  [SerializeField]
10  [Range(0f, 360f)]
11  protected float CurrentPointerOrientation;
12 
13  [SerializeField]
14  [Tooltip("Source transform for raycast origin - leave null to use default transform")]
15  protected Transform RaycastOrigin;
16 
20  public virtual float PointerOrientation
21  {
22  get
23  {
24  return CurrentPointerOrientation + (RaycastOrigin != null ? RaycastOrigin.eulerAngles.y : transform.eulerAngles.y);
25  }
26  set
27  {
28  CurrentPointerOrientation = value;
29  }
30  }
31 
35  public virtual Vector3 PointerDirection
36  {
37  get { return RaycastOrigin != null ? RaycastOrigin.forward : transform.forward; }
38  }
39 }
Waits for a controller to be instantiated, then attaches itself to a specified element ...
virtual float PointerOrientation
The Y orientation of the pointer target - used for touchpad rotation and navigation ...
virtual Vector3 PointerDirection
The forward direction of the targeting ray