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,
LayerMask  mask 
)
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.
maskMask passed to the Linecast function.
Returns
True if something is hit, otherwise false.

Definition at line 118 of file AVR_Utils.cs.

119  {
120  for (int i = 0; i < positions.Length - 1; i++)
121  {
122  if (Physics.Linecast(positions[i], positions[i + 1], out hit, mask))
123  {
124  return true;
125  }
126  }
127  hit = new RaycastHit();
128  return false;
129  }