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,
Matrix4x4  localToWorld 
)
inlinestatic

Perform linecasts along a spline of positions given in local space.

Parameters
positionsList of positions in LOCAL space. Linecasts will be performed for each pair of subsequent points
hitRaycastHit of the first hit encountered.
localToWorldTransformation matrix to convert given positions from local to world space.
Returns
True if something is hit, otherwise false.

Definition at line 138 of file AVR_Utils.cs.

139  {
140  for (int i = 0; i < positions.Length - 1; i++)
141  {
142  if (Physics.Linecast(localToWorld * positions[i], localToWorld * positions[i + 1], out hit))
143  {
144  return true;
145  }
146  }
147  hit = new RaycastHit();
148  return false;
149  }