VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
static bool AVR.Core.Utils.Phys.PathCast ( Vector3[]  positions,
out RaycastHit  hit 
)
inlinestatic

Perform linecasts along a spline of positions.

Parameters
positionsList of positions. Linecasts will be performed for each pair of subsequent points
hitRaycastHit of the first hit encountered.
Returns
True if something is hit, otherwise false.

Definition at line 98 of file AVR_Utils.cs.

99  {
100  for (int i = 0; i < positions.Length - 1; i++)
101  {
102  if (Physics.Linecast(positions[i], positions[i + 1], out hit))
103  {
104  return true;
105  }
106  }
107  hit = new RaycastHit();
108  return false;
109  }