14 [Tooltip(
"Transform for which this cursor modifier applies its various properties.")]
17 [Tooltip(
"How much a cursor should be offset from the surface of the object when overlapping.")]
18 public Vector3 CursorOffset = Vector3.zero;
20 [Tooltip(
"Direction of the cursor offset.")]
21 public Vector3 CursorNormal = Vector3.back;
23 [Tooltip(
"Scale of the cursor when looking at this object.")]
24 public Vector3 CursorScaleOffset = Vector3.one;
26 [Tooltip(
"Should the cursor snap to the object.")]
27 public bool SnapCursor =
false;
29 [Tooltip(
"If true, the normal from the pointing vector will be used to orient the cursor " +
30 "instead of the targeted object's normal at point of contact.")]
31 public bool UseGazeBasedNormal =
false;
33 [Tooltip(
"Should the cursor be hiding when this object is focused.")]
34 public bool HideCursorOnFocus =
false;
36 [Tooltip(
"Cursor animation parameters to set when this object is focused. Leave empty for none.")]
41 if (HostTransform == null)
43 HostTransform = transform;
53 return HideCursorOnFocus;
63 position = HostTransform.position +
64 HostTransform.TransformVector(CursorOffset);
71 position = focusDetails.
Point + HostTransform.TransformVector(CursorOffset);
82 Vector3 forward = UseGazeBasedNormal ? -lastStep.
Direction : HostTransform.rotation * CursorNormal;
85 if (forward.magnitude > 0)
87 rotation = Quaternion.LookRotation(forward, Vector3.up);
99 return CursorScaleOffset;
104 position = GetModifiedPosition(cursor);
105 rotation = GetModifiedRotation(cursor);
106 scale = GetModifiedScale(cursor);