Skip to content

Commit

Permalink
Pull request changes, round 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Railboy committed Nov 10, 2017
1 parent d3d19ff commit 00e448a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
3 changes: 3 additions & 0 deletions Assets/HoloToolkit/Input/Scripts/Focus/IPointingSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public interface IPointingSource

PointerResult Result { get; set; }

[Obsolete("Will be removed in a later version. Use OnPreRaycast / OnPostRaycast instead.")]
void UpdatePointer();

void OnPreRaycast();

void OnPostRaycast();
Expand Down
19 changes: 13 additions & 6 deletions Assets/HoloToolkit/Input/Scripts/Focus/InputSourcePointer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public class InputSourcePointer : IPointingSource
[Obsolete("Will be removed in a later version. Use Rays instead.")]
public Ray Ray { get { return Rays[0]; } }

public RayStep[] Rays {
public RayStep[] Rays
{
get
{
return rays;
Expand All @@ -46,8 +47,14 @@ public bool InteractionEnabled
}

private RayStep[] rays = new RayStep[1] { new RayStep(Vector3.zero, Vector3.forward) };

public void OnPreRaycast()

[Obsolete("Will be removed in a later version. Use OnPreRaycast / OnPostRaycast instead.")]
public void UpdatePointer()
{

}

public virtual void OnPreRaycast()
{
if (InputSource == null)
{
Expand All @@ -60,7 +67,7 @@ public void OnPreRaycast()
Ray pointingRay = default(Ray);
if (InputSource.TryGetPointingRay(InputSourceId, out pointingRay))
{
rays[0].CopyRay(pointingRay, FocusManager.Instance.GetPointingExtent (this));
rays[0].CopyRay(pointingRay, FocusManager.Instance.GetPointingExtent(this));
}
}

Expand All @@ -71,7 +78,7 @@ public void OnPreRaycast()
}
}

public void OnPostRaycast()
public virtual void OnPostRaycast()
{
// Nothing needed
}
Expand All @@ -88,6 +95,6 @@ public bool InputIsFromSource(BaseEventData eventData)
return (inputData != null)
&& (inputData.InputSource == InputSource)
&& (inputData.SourceId == InputSourceId);
}
}
}
}
10 changes: 8 additions & 2 deletions Assets/HoloToolkit/Input/Scripts/Gaze/GazeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,18 @@ private void UpdateGazeInfo()
UpdateHitPosition();
}

public void OnPreRaycast()
[Obsolete("Will be removed in a later version. Use OnPreRaycast / OnPostRaycast instead.")]
public void UpdatePointer()
{

}

public virtual void OnPreRaycast()
{
UpdateGazeInfo();
}

public void OnPostRaycast()
public virtual void OnPostRaycast()
{
// Nothing needed
}
Expand Down

0 comments on commit 00e448a

Please sign in to comment.